Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Insert image names to database table. Help
  • Hai,

    i m using multiple uploading image using uploadify script,

    I want to insert the image names to database table.. i tried to insert after "move_upload" ,like the below
    $insertQuery=mysql_query("INSERT INTO image(image_id,image,userip) VALUES('','$StrImage','$ip_user')");
    but its not inserting into table. i have check all the database connections and all its fine but its not inserting ..
    i need to insert each image name to table. how can i do it ?

    Please if anyone knows help me..

    Thanks
    Vadivel Natarajan
  • hey vadivel...
    i have same problem.have u got its solution???
  • I don't think uploadify is anything to do with your problem.... I think your issue is more to do with MySQL & PHP.

    First, it looks as if your query is invalid.... you list 3 fields that will be inserted (image_id,image,userip) but only give 2 values ($StrImage and $ip_user).

    Next, Is the MySQL field "image_id" an auto-increment field?
    If so, you don't need to worry about inserting it, it will happen automatically.
    If you want to insert a zero value, then try inserting VALUES(0,$strImage,$ip_user)

    Finally, I find it better to use " to drop in/out of php string parsing. It helps you keep a track on what is a string and what is a variable

    Try this as your query (or drop image_id if not needed)
    $insertQuery=mysql_query("INSERT INTO image(image_id,image,userip) VALUES(0,'".$StrImage."','".$ip_user."')");