biscoe Posted October 12, 2006 Share Posted October 12, 2006 [code]$database = mysql_connect("localhost", "myusername", "mypassword");mysql_select_db("mydatabase",$database); $sql = sprintf("INSERT INTO users (image_url, image_name, user) VALUES ( '%s','%s','%s')", mysql_real_escape_string($url),mysql_real_escape_string($file_name),mysql_real_escape_string($uname)); echo $sql; mysql_query($sql);[/code]this code is ran whenever a file is uploaded successfully. I know that it is running cause it prints the sql statement correctly and the sql shows up as:[code]INSERT INTO users (image_url, image_name, user) VALUES ( 'upload_img/asdfsdf.txt','asdfsdf.txt','tyler')[/code]Im not even getting any error messages....and nothing is in the databasethanks in advance. Link to comment https://forums.phpfreaks.com/topic/23796-help-i-cant-enter-data/ Share on other sites More sharing options...
fenway Posted October 12, 2006 Share Posted October 12, 2006 Check the return value from mysql_query() and/or mysql_error(). Link to comment https://forums.phpfreaks.com/topic/23796-help-i-cant-enter-data/#findComment-108104 Share on other sites More sharing options...
biscoe Posted October 13, 2006 Author Share Posted October 13, 2006 problem solved........... thanks for the help Link to comment https://forums.phpfreaks.com/topic/23796-help-i-cant-enter-data/#findComment-108364 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.