ballouta Posted June 3, 2009 Share Posted June 3, 2009 Hello I have the following query, i want to display the table header if the result was > 0 I was trying this but it is not working: <?php $sql = mysql_query("SELECT * from members where `username` LIKE '%$usr%' "); if (mysql_num_rows($sql) > 0) { //print table header while( $row = mysql_fetch_array($sql)) { //print members found } } else { //no members found { ?> please help Thank you Link to comment https://forums.phpfreaks.com/topic/160758-result-status/ Share on other sites More sharing options...
JonnoTheDev Posted June 3, 2009 Share Posted June 3, 2009 Your code is fine. What is the issue? If 0 results are found check that your query is correct. Link to comment https://forums.phpfreaks.com/topic/160758-result-status/#findComment-848403 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.