delirium Posted November 11, 2009 Report Share Posted November 11, 2009 Hey guys, im trying to get my webpage to display the number of "support tickets" that the user has. Here is the code(session->username is self explainitory): $getstickets = mysql_query( "SELECT * FROM `sticket` WHERE `username` = '$session->username'" ); $result = mysql_query($getstickets); mysql_num_rows($result); echo mysql_num_rows($result); But it keeps saying mysql_num_rows() supplied argument is not a valid mySQL result resource. Can anyone tell me what im doing wrong? Quote Link to comment Share on other sites More sharing options...
jlhaslip Posted November 11, 2009 Report Share Posted November 11, 2009 $getstickets = mysql_query( "SELECT * FROM `sticket` WHERE `username` = '$session->username'" ); $result = mysql_query($getstickets); $ticks = mysql_num_rows($result); echo $ticks; try that Quote Link to comment Share on other sites More sharing options...
BeeDev Posted November 12, 2009 Report Share Posted November 12, 2009 more like $result = mysql_query( "SELECT * FROM `sticket` WHERE `username` = '$session->username'" ); $ticks = mysql_num_rows($result); echo $ticks; Quote Link to comment Share on other sites More sharing options...
delirium Posted November 21, 2009 Author Report Share Posted November 21, 2009 Thanks alot! It works great now Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.