Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Load_file in mysql

Discussion in 'General Discussion' started by youp, Feb 15, 2007.

  1. youp

    youp Well-Known Member

    Joined:
    Oct 30, 2001
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    306
    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. youp

    youp Well-Known Member

    Joined:
    Oct 30, 2001
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    306
    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 ;
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice