Jump to content

Recommended Posts

Hello,

 

When I run the query below, I get this error for the line "list($isThere) = mysql_fetch_row($resA);":

 

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource

 

Any ideas why?

 

Thanks in advance,

 

John

 


<?php
$result = mysql_query("SHOW TABLES FROM feather") 
or die(mysql_error()); 


while(list($table)= mysql_fetch_row($result))
{
  $sqlA = "SELECT COUNT(*) FROM $table WHERE `site` LIKE '$entry'";
  $resA = mysql_query($sqlA);
  list($isThere) = mysql_fetch_row($resA);
  if ($isThere)
  {
     $table_list[] = $table;
  }
}
?>

Link to comment
https://forums.phpfreaks.com/topic/162292-mysql_fetch_row-error/
Share on other sites

check to see if that sql statement is executing properly?

change the $reA = mysql_query... line to the following... you'll want to change it back when you make the site live and put in some custom error handling

$resA = mysql_query($sqlA) or die(mysql.error());

 

OK, MadTechnie,

 

Now, when I enter in miami.com for $entry, I get the following error message:

 

SELECT COUNT(*) FROM #&*+ WHERE `site` LIKE 'miami.com':You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

MadTechnie,

 

When I follow your instructions, I get the following error:

 

SELECT COUNT(*) FROM WHERE `site` LIKE '#&*+':You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `site` LIKE '#&*+'' at line 1
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.