lvertel Posted March 11, 2009 Share Posted March 11, 2009 hello i am not a newbie in mysql but it seems i am having an STUPID issue i cant solve.... this is my query : $sql33="INSERT INTO tbl_images (id_artist_img, name_image, img_path, thmb_img_path) VALUES ('".$id_artist."', '".$imagepath."', '".$file."', '".$save."');"; $sql33 = mysql_query($sql33,$db_connection) or die ("Immage not uploaded"); it gives me the DIE error(image not uploaded). i cant figure it why,because when i print the $sql33 , i receive the data.... :s what is the problem ? thank you in advance Quote Link to comment https://forums.phpfreaks.com/topic/149008-solved-mysql-insert/ Share on other sites More sharing options...
Mchl Posted March 11, 2009 Share Posted March 11, 2009 Please use tags for your code Change $sql33 = mysql_query($sql33,$db_connection) or die ("Immage not uploaded"); to $result = mysql_query($sql33,$db_connection) or die (mysql_error().": $sql33"); Quote Link to comment https://forums.phpfreaks.com/topic/149008-solved-mysql-insert/#findComment-782461 Share on other sites More sharing options...
lvertel Posted March 11, 2009 Author Share Posted March 11, 2009 hello thank you for your advice, i receive this error now : Duplicate entry '127' for key 1: INSERT INTO tbl_images (id_artist_img, name_image, img_path, thmb_img_path) VALUES ('189', '1236808442.jpg', 'users/images/1236808442.jpg', 'users/images/thumbs/thmb_1236808442.jpg'); what should this mean ? Quote Link to comment https://forums.phpfreaks.com/topic/149008-solved-mysql-insert/#findComment-782466 Share on other sites More sharing options...
Mchl Posted March 11, 2009 Share Posted March 11, 2009 What type is id_artist_img field in the tbl_images? I'm guessing TINYINT. Change to INTEGER. Quote Link to comment https://forums.phpfreaks.com/topic/149008-solved-mysql-insert/#findComment-782471 Share on other sites More sharing options...
lvertel Posted March 11, 2009 Author Share Posted March 11, 2009 thank you very much, that solved my problem it was tinyint, hehe. i've put it to INT now. do you suggest me what LENGHT should i put and what is the maximum ??? what happens if i reach the maximum number of user under INT ???? anyways,these were just additional questions , thanks for solving my problem ! Quote Link to comment https://forums.phpfreaks.com/topic/149008-solved-mysql-insert/#findComment-782474 Share on other sites More sharing options...
Mchl Posted March 11, 2009 Share Posted March 11, 2009 As you have seen by yourself, when the maximum is reached, the table will stop accepting new entries (maximum for SIGNED TINYINT is 127) To check maximum values for other datatypes consult the manual http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html Quote Link to comment https://forums.phpfreaks.com/topic/149008-solved-mysql-insert/#findComment-782485 Share on other sites More sharing options...
lvertel Posted March 11, 2009 Author Share Posted March 11, 2009 thanks Quote Link to comment https://forums.phpfreaks.com/topic/149008-solved-mysql-insert/#findComment-782488 Share on other sites More sharing options...
fenway Posted March 13, 2009 Share Posted March 13, 2009 You should use INT UNSIGNED -- twice the values, same price -- and the "length" field does nothing. Quote Link to comment https://forums.phpfreaks.com/topic/149008-solved-mysql-insert/#findComment-783850 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.