Select statement working in localhost and phpMyAdmin but not in the script

zumtorre

New Member
Messages
2
Reaction score
0
Points
0
I have a Select statement with a subquery and finally a groupby which works perfectly in phpMyAdmin and on my localhost but it doesnt work while i run the script on x10Hosting.

My Query:

Code:
SELECT replyid, forcommentid FROM commentreply WHERE forcommentid IN(SELECT commentid FROM comments c WHERE c.userid = " . $userId . ") GROUP BY commentreply.forcommentid ORDER BY replyid DESC

As you can see the $userId is the only variable im using in this query, also i have made sure its not null and the value exits in my tables. Im using the simply mysql extension of the php as this variable does not depend on users input.

PS: Just to be more specific the error that i get is:

Code:
[B]Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in [B]/home/****/public_html/User/index.php on line [B]250[/B][/B][/B]
 
Top