List:General Discussion« Previous MessageNext Message »
From:Michael Stassen Date:November 30 2005 5:02pm
Subject:Re: Rewriting subquery for old MySQL
View as plain text  
Alex Gemmell wrote:
<snip>
> 
> The error I get whichever way I tried it was the same:
> 
> [ERROR]
> Warning: mysql_num_rows(): supplied argument is not a valid MySQL result 
> resource in C:\alexg\newcs\phpinc\status-Trans.php on line 72
> [/ERROR]
> 
> The line number always correlated to this bit of PHP code:
> $result_activities = mysql_query($query);
> 
> Experience tells me this error can mean anything from "no rows in table 
> to return" to "the query didn't work at all".  There's defo data there 
> to be returned, I'm sure this query just needs tweaking.
> 
> Alex

Well, the second query won't work if the first query failed.  That's why you 
need to verify that each query works, and print the error from mysql if it 
doesn't.  If you let mysql tell you what went wrong, you don't have to guess 
based on past experience.

That said, my expectation is that the first query failed due to lack of the 
CREATE TEMPORARY TABLES privilege.

Michael

Thread
Rewriting subquery for old MySQLAlex Gemmell30 Nov
  • Re: Rewriting subquery for old MySQLSGreen30 Nov
    • Re: Rewriting subquery for old MySQLAlex Gemmell30 Nov
      • Re: Rewriting subquery for old MySQLrouvas30 Nov
        • Re: Rewriting subquery for old MySQLAlex Gemmell30 Nov
        • Re: Rewriting subquery for old MySQLAlex Gemmell30 Nov
        • Re: Rewriting subquery for old MySQLSGreen30 Nov
      • Re: Rewriting subquery for old MySQLDan Nelson30 Nov
        • Re: Rewriting subquery for old MySQLAlex Gemmell30 Nov
          • Re: Rewriting subquery for old MySQLMichael Stassen30 Nov
      • Re: Rewriting subquery for old MySQLMichael Stassen30 Nov
        • Re: Rewriting subquery for old MySQL - SOLVEDAlex Gemmell30 Nov
          • Re: Rewriting subquery for old MySQL - SOLVED - correction!Alex Gemmell6 Dec