Dan Nelson wrote:
In the last episode (Nov 30), Alex Gemmell said:

I tried splitting up the queries to see if it helped but it didn't
work either:

[PHP]
$query1 = "CREATE TEMPORARY TABLE tmpSubquery
        SELECT * FROM tblactivities
        WHERE Assignment_ID='".$row['Assignment_ID']."'
        ORDER BY Date DESC LIMIT 10;";
mysql_query($query1);

query2 = "SELECT * FROM tmpSubquery ORDER BY Date ASC;";
$result_activities = mysql_query($query2);

query3 = "DROP TEMPORARY TABLE tmpSubquery;";
mysql_query($query3);
[/PHP]


How do you know it didn't work?  What error message are you getting?


The error I get whichever way IO 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

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to