AndyB Posted August 18, 2007 Share Posted August 18, 2007 change to <?php $query2 = mysql_query("INSERT INTO games (gName, gDescription, gSwfFile, gInCategory, gVisible, gOrder, gWidth, gHeight, description2, des2, sponsor_name, sponsor_link, filetype, gThumb, gId, gPlays, playstoday) values ('".addslashes($title)."', '".addslashes($descr)."', '".addslashes($md5)."', '1', '1', '0', '300', '350\', '', '', '', '', '1', '$md5.png', '999999', '', '')"); mysql_query($query2) or die(mysql_error().'<br /><br />Query:'.$query2); ?> Surely that should have been: <?php $query2 = "INSERT INTO games (gName, gDescription, gSwfFile, gInCategory, gVisible, gOrder, gWidth, gHeight, description2, des2, sponsor_name, sponsor_link, filetype, gThumb, gId, gPlays, playstoday) values ('".addslashes($title)."', '".addslashes($descr)."', '".addslashes($md5)."', '1', '1', '0', '300', '350\', '', '', '', '', '1', '$md5.png', '999999', '', '')"; mysql_query($query2) or die(mysql_error().'<br /><br />Query:'.$query2); ?> #1 - define the query string ... $query2 = "INSERT ....." #2 - execute the query mysql_query($query2) mysql_query should only appear ONCE in those two lines. Quote Link to comment https://forums.phpfreaks.com/topic/65523-solved-script-breaking-on-mysql_result/page/2/#findComment-327805 Share on other sites More sharing options...
RAH Posted August 19, 2007 Author Share Posted August 19, 2007 I've made those changes and the error remains. Quote Link to comment https://forums.phpfreaks.com/topic/65523-solved-script-breaking-on-mysql_result/page/2/#findComment-327818 Share on other sites More sharing options...
AndyB Posted August 19, 2007 Share Posted August 19, 2007 Perhaps it would be a good time to post your entire script [between code tags], or at least the totally relevant parts, after making sure that what you post is identical to the current version you're using (that's failing). A database schema might also be useful information for us. There's something fundamentally wrong here. Quote Link to comment https://forums.phpfreaks.com/topic/65523-solved-script-breaking-on-mysql_result/page/2/#findComment-327828 Share on other sites More sharing options...
magic2goodil Posted August 19, 2007 Share Posted August 19, 2007 AndyB mentioned that Query was empty is an error. Do you have anything in your db that matches what you are referencing, or is it in fact returning nothing? I believe your die comes from an empty query being returned. If nothing matches in the db, try adding something to match it. Quote Link to comment https://forums.phpfreaks.com/topic/65523-solved-script-breaking-on-mysql_result/page/2/#findComment-327850 Share on other sites More sharing options...
MadTechie Posted August 19, 2007 Share Posted August 19, 2007 <?php $query2 = "INSERT INTO games (gName, gDescription, gSwfFile, gInCategory, gVisible, gOrder, gWidth, gHeight, description2, des2, sponsor_name, sponsor_link, filetype, gThumb, gId, gPlays, playstoday) values ('".addslashes($title)."', '".addslashes($descr)."', '".addslashes($md5)."', '1', '1', '0', '300', '350', '', '', '', '', '1', '$md5.png', '999999', '', '')"; mysql_query($query2) or die(mysql_error().'<br /><br />Query:'.$query2); ?> last one ('\350' to '350') then post the full thing.. Quote Link to comment https://forums.phpfreaks.com/topic/65523-solved-script-breaking-on-mysql_result/page/2/#findComment-327962 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.