Jump to content

[SOLVED] Script breaking on mysql_result


RAH

Recommended Posts

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.

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.

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.

<?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..

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.