Jump to content

[SOLVED] Error:


ryeman98

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

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