geekisthenewsexy Posted October 1, 2010 Share Posted October 1, 2010 hi, i just want to ask something about the count function. is it ok to use it for counting rows on a table them and displaying not the number of records but the actual records instead?or is there some other function to go with count to be able to do this? Quote Link to comment https://forums.phpfreaks.com/topic/214888-help-on-using-count/ Share on other sites More sharing options...
chintansshah Posted October 1, 2010 Share Posted October 1, 2010 use mysql_num_rows() for number of record in recordset. Quote Link to comment https://forums.phpfreaks.com/topic/214888-help-on-using-count/#findComment-1117857 Share on other sites More sharing options...
geekisthenewsexy Posted October 1, 2010 Author Share Posted October 1, 2010 yes,but it will just display the number of rows. like,field1 has 3 records etc..how about the actual records?like dog,cat,boy..? Quote Link to comment https://forums.phpfreaks.com/topic/214888-help-on-using-count/#findComment-1117860 Share on other sites More sharing options...
chintansshah Posted October 1, 2010 Share Posted October 1, 2010 then, you should use mysql_fetch_array() after excute your query. like $sql = mysql_query("SELECT * FROM country ORDER BY country_name ASC"); while($data = mysql_fetch_array($sql)) { echo 'Country Name - '.$data['country_name'].' Country id-'.$data['id'].'<br>'; } echo "</form>"; Quote Link to comment https://forums.phpfreaks.com/topic/214888-help-on-using-count/#findComment-1117866 Share on other sites More sharing options...
sandy1028 Posted October 1, 2010 Share Posted October 1, 2010 Ok Thanks. Occurence of character "<p>" in a value of a particular column. Quote Link to comment https://forums.phpfreaks.com/topic/214888-help-on-using-count/#findComment-1117868 Share on other sites More sharing options...
geekisthenewsexy Posted October 1, 2010 Author Share Posted October 1, 2010 ok, i'll try it out..thanks Quote Link to comment https://forums.phpfreaks.com/topic/214888-help-on-using-count/#findComment-1117874 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.