Jump to content

Counting the number of rows??


delirium

Recommended Posts

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?

Link to comment
Share on other sites

  • 2 weeks later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...