marklarah Posted January 20, 2008 Share Posted January 20, 2008 <?php $check = "SELECT * FROM users WHERE active = '1'"; mysql_query($check) or die('Error, query failed now'); $us = mysql_num_rows($check); echo '<table border="0">'; while ($us = mysql_fetch_assoc($check)){ echo '<tr><td><b>'; echo $us['username']; echo ' ('; echo $us['level']; echo ')<b></td></tr>'; } echo '</table>'; ?> Why wont it work???? Quote Link to comment https://forums.phpfreaks.com/topic/86918-my-sql-lookup-help/ Share on other sites More sharing options...
trq Posted January 20, 2008 Share Posted January 20, 2008 Change... or die('Error, query failed now'); to.... or die(mysql_error()); Do you get an error? Quote Link to comment https://forums.phpfreaks.com/topic/86918-my-sql-lookup-help/#findComment-444377 Share on other sites More sharing options...
revraz Posted January 20, 2008 Share Posted January 20, 2008 What purpose does this line serve $us = mysql_num_rows($check); Quote Link to comment https://forums.phpfreaks.com/topic/86918-my-sql-lookup-help/#findComment-444382 Share on other sites More sharing options...
marklarah Posted January 20, 2008 Author Share Posted January 20, 2008 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home2/tlscom/public_html/side.php on line 104 Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home2/tlscom/public_html/side.php on line 114 Quote Link to comment https://forums.phpfreaks.com/topic/86918-my-sql-lookup-help/#findComment-444389 Share on other sites More sharing options...
marklarah Posted January 20, 2008 Author Share Posted January 20, 2008 What purpose does this line serve $us = mysql_num_rows($check); Ive changed it to mysql_fetch_array. Its for echoing the user (from the returned array) Quote Link to comment https://forums.phpfreaks.com/topic/86918-my-sql-lookup-help/#findComment-444393 Share on other sites More sharing options...
trq Posted January 20, 2008 Share Posted January 20, 2008 Post your current code. ps: You might want to take a look at this thread in regard to checking your results prior to attempting to use them. Quote Link to comment https://forums.phpfreaks.com/topic/86918-my-sql-lookup-help/#findComment-444395 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.