Thread: insert

    #1
  1. No Profile Picture
    pnoren
    Guest
    Devshed Newbie (0 - 499 posts)
    having problems with a php-script when I am doing a insert

    it tells me:

    Fatal error: Unable to open C:wwwroot/mp3/insert.php in - on line 0
    No input file specified.
    what am i doing wrong?

    <html>
    <head>
    <title> upload to database </title>
    </head>
    <body>
    <? If ( $mp3 !="none" )
    {
    $filesize = filesize($mp3);
    $mysqlMp3 = addslashes( fread (fopen($mp3, "r"), $filesize) );
    mysql_connect( "localhost", "root", "" )
    or die("Unable to open connection to mySql-database.");
    @mysql_select_db("test")
    or die("Unable to select database.");
    mysql_query("INSERT INTO mp3
    VALUES( $artist , $mysqlMp3, $title );

    mysql_close();
    }
    else
    {
    echo "You didn't submit any file, go back and try again.";
    }
    ?>
    </body>
    </html>

    --
    ________________________________________
    Patrik Norén




    ------------------
    patrik
  2. #2
  3. No Profile Picture
    dynamic1
    Guest
    Devshed Newbie (0 - 499 posts)
    At first glance one of your lines of code is malformed

    mysql_query("INSERT INTO mp3 VALUES( $artist , $mysqlMp3, $title );

    Should read

    mysql_query("INSERT INTO mp3
    VALUES( $artist , $mysqlMp3, $title )");

    May help you out

Similar Threads

  1. Zip code validation
    By krwyth in forum MySQL Help
    Replies: 2
    Last Post: January 5th, 2004, 02:29 PM
  2. error - parent key
    By mbonfyre in forum Oracle Development
    Replies: 1
    Last Post: November 29th, 2003, 01:44 PM
  3. Temporary table Questions
    By dimitrisk in forum MySQL Help
    Replies: 11
    Last Post: October 6th, 2003, 02:07 PM
  4. Using Array to insert data
    By traffic_jammer in forum PHP Development
    Replies: 1
    Last Post: September 19th, 2003, 03:50 PM
  5. Simple dynamic img, swf gallery
    By gmarik in forum PHP Development
    Replies: 0
    Last Post: May 2nd, 2003, 03:14 AM

IMN logo majestic logo threadwatch logo seochat tools logo