ryeman98 Posted June 25, 2007 Share Posted June 25, 2007 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/4617/domains/sunnyneo.com/html/admin/customisation/index.php on line 355 Line 355: while($row4 = mysql_fetch_array($editclothing)) { Help? Link to comment https://forums.phpfreaks.com/topic/57151-solved-error/ Share on other sites More sharing options...
.Stealth Posted June 25, 2007 Share Posted June 25, 2007 Well whats in $editclothing? Gonna need more info than that! Link to comment https://forums.phpfreaks.com/topic/57151-solved-error/#findComment-282378 Share on other sites More sharing options...
ryeman98 Posted June 25, 2007 Author Share Posted June 25, 2007 True. Sorry. $editclothing = mysql_query("SELECT * FROM CustomisationClothing WHERE name='$name'"); Link to comment https://forums.phpfreaks.com/topic/57151-solved-error/#findComment-282380 Share on other sites More sharing options...
Pastulio Posted June 25, 2007 Share Posted June 25, 2007 all I can think of is a syntax error $editclothing = mysql_query("SELECT * FROM CustomisationClothing WHERE name='$name'"); should be: $editclothing = mysql_query("SELECT * FROM `CustomisationClothing` WHERE `name`='$name'"); Link to comment https://forums.phpfreaks.com/topic/57151-solved-error/#findComment-282381 Share on other sites More sharing options...
ryeman98 Posted June 25, 2007 Author Share Posted June 25, 2007 all I can think of is a syntax error $editclothing = mysql_query("SELECT * FROM CustomisationClothing WHERE name='$name'"); should be: $editclothing = mysql_query("SELECT * FROM `CustomisationClothing` WHERE `name`='$name'"); Nope, didn't work. Link to comment https://forums.phpfreaks.com/topic/57151-solved-error/#findComment-282383 Share on other sites More sharing options...
ryeman98 Posted June 25, 2007 Author Share Posted June 25, 2007 When I take out the mysql_fetch_array() it works fine... Link to comment https://forums.phpfreaks.com/topic/57151-solved-error/#findComment-282403 Share on other sites More sharing options...
Pastulio Posted June 25, 2007 Share Posted June 25, 2007 Then I don't know but what I do know is, that you shouldn't be using a while loop because you'll have only one result anyway (well that's what your code looks like), so you could just make it like this $query = "SELECT * FROM `CustomisationClothing` WHERE `name`='$name'"; $result = mysql_query($query); $row = mysql_fetch_array ($result); I don't know why but when I code it like that it always works for me, unless the table you are looking for does not exist. Link to comment https://forums.phpfreaks.com/topic/57151-solved-error/#findComment-282406 Share on other sites More sharing options...
ryeman98 Posted June 25, 2007 Author Share Posted June 25, 2007 It's showing the page now but still has that error... :-\ Link to comment https://forums.phpfreaks.com/topic/57151-solved-error/#findComment-282410 Share on other sites More sharing options...
Pastulio Posted June 25, 2007 Share Posted June 25, 2007 Maybe you are not connected to the database, or the right one or something? Because it should always find a valid result if the table exists, even if there are no rows in it. So do a routine check for any typo's or other bugs. Because, when PHP shows an error on a line, your problem could also lie in a different portion of your code Link to comment https://forums.phpfreaks.com/topic/57151-solved-error/#findComment-282411 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.