ryeman98 Posted June 26, 2007 Share Posted June 26, 2007 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/4617/domains/somesite.com/html/admin/customisation/index.php on line 515 Lines 512-531: // BACKGROUND=EDIT $id = $_POST['id']; $getback = ("SELECT id FROM CustomisationBackgrounds WHERE id='$id'"); $row5 = mysql_fetch_array ($getback); ?> <form name="editBackground" action="editBackground.php" method="post"> <input type="hidden" name="id" value="<?php echo $row5['id']; ?>" /> <table width="100%" border="0" cellpadding="0" cellspacing="5"> <tr> <td><b>Name:</b></td> <td><input type="text" name="name" value="<?php echo $row5['name']; ?>" /></td> </tr> <tr> <td><b>IMG URL:</b></td> <td><input type="text" name="img_url" value="<?php echo $row5['img_url']; ?>" size="60" /></td> </tr> <tr> <td> </td> <td><input type="submit" name="submit" value="Edit Background" /></td> </tr> </table> </form> Quote Link to comment Share on other sites More sharing options...
teng84 Posted June 26, 2007 Share Posted June 26, 2007 "SELECT id FROM CustomisationBackgrounds WHERE id='".$id."'" Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted June 26, 2007 Share Posted June 26, 2007 I'm assuming this is line 515: $getback = ("SELECT id FROM CustomisationBackgrounds WHERE id='$id'"); If it is, change it to this: <?php $getback = ("SELECT id FROM CustomisationBackgrounds WHERE id='$id'")or die(mysql_error()); ?> That will tell you what the problem is. Quote Link to comment Share on other sites More sharing options...
ryeman98 Posted June 26, 2007 Author Share Posted June 26, 2007 I'm assuming this is line 515: $getback = ("SELECT id FROM CustomisationBackgrounds WHERE id='$id'"); If it is, change it to this: <?php $getback = ("SELECT id FROM CustomisationBackgrounds WHERE id='$id'")or die(mysql_error()); ?> That will tell you what the problem is. I still get the same error :-\ I checked the table name and it's right so I just don't get it... Quote Link to comment Share on other sites More sharing options...
teng84 Posted June 26, 2007 Share Posted June 26, 2007 "SELECT id FROM CustomisationBackgrounds WHERE id='".$id."'" Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted June 26, 2007 Share Posted June 26, 2007 Just realized something, You don't ever use mysql_query() <?php $getback = mysql_query("SELECT id FROM CustomisationBackgrounds WHERE id='$id'")or die(mysql_error()); ?> Quote Link to comment Share on other sites More sharing options...
ryeman98 Posted June 26, 2007 Author Share Posted June 26, 2007 "SELECT id FROM CustomisationBackgrounds WHERE id='".$id."'" Maybe you should learn more. That doesn't matter. Quote Link to comment Share on other sites More sharing options...
ryeman98 Posted June 26, 2007 Author Share Posted June 26, 2007 Just realized something, You don't ever use mysql_query() <?php $getback = mysql_query("SELECT id FROM CustomisationBackgrounds WHERE id='$id'")or die(mysql_error()); ?> Thanks! After a full day of coding, that sort of thing can happen Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted June 26, 2007 Share Posted June 26, 2007 Haha, yeah...I hear you Quote Link to comment Share on other sites More sharing options...
teng84 Posted June 26, 2007 Share Posted June 26, 2007 echo this and give me the result then tell me f i have to learn more "SELECT id FROM CustomisationBackgrounds WHERE id='".$id."'" Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted June 26, 2007 Share Posted June 26, 2007 echo this and give me the result then tell me f i have to learn more "SELECT id FROM CustomisationBackgrounds WHERE id='".$id."'" Conocation doesn't matter when the variable is in between double quotes. Your way and ryeman98's way would both work. ryeman98 was just stating that it doesn't matter, so it was pointless to suggest it =] Quote Link to comment 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.