Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Oct 2001
    Posts
    46

    Default Load_file in mysql

    i have a trouble with this script :

    <?php


    $dbh=mysql_connect ("localhost", "xxxxx", "xxxxx") or die ("I cannot connect to the database because: " . mysql_error());
    mysql_select_db ("xxxxx");

    $query = "INSERT INTO Files (Name,Class,Size,Date,Lang,Title,Bytes) VALUES
    ('start.bmp','','303056','2007-01-28 12:40:31','','Start Screen', LOAD_FILE( '/etc/fstab' ))";

    $result = mysql_query($query);

    if (!$result) {
    die('Invalid query: ' . mysql_error());
    }

    ?>


    ->

    : php index.php

    X-Powered-By: PHP/5.1.6
    Content-type: text/html

    Invalid query: Column 'Bytes' cannot be null


    i use mysql 5.0.24...

    i don't understand, is probably a bug ?

    thanks

  2. #2
    Member
    Join Date
    Oct 2001
    Posts
    46

    Default

    structure of table mysql ->

    --
    -- Table structure for table `Files`
    --

    CREATE TABLE `Files` (
    `id` int(11) NOT NULL auto_increment,
    `Name` varchar(255) NOT NULL,
    `Class` varchar(255) NOT NULL,
    `Size` varchar(255) NOT NULL,
    `Date` datetime NOT NULL,
    `Lang` varchar(2) NOT NULL,
    `Title` varchar(255) NOT NULL,
    `Bytes` longblob NOT NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=15 ;

Similar Threads & Tags
Similar threads

  1. Replies: 13
    Last Post: 06-15-2010, 04:31 PM
  2. Replies: 13
    Last Post: 06-15-2010, 04:31 PM
  3. Remote MySQL and /var/lib/mysql/mysql.sock
    By emechanic in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 12-02-2009, 01:08 PM
  4. Replies: 1
    Last Post: 04-21-2007, 01:23 AM
  5. Replies: 0
    Last Post: 06-27-2004, 02:53 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube