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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.