Rusty.Metal Posted March 29, 2003 Share Posted March 29, 2003 (edited) How can i make a script count the number of entries, that have "wallpapers" in the Type row.. a table so like in a download script it would show how meany files i have Edited March 29, 2003 by aaronsam Link to comment Share on other sites More sharing options...
0 Tim Dorr Veteran Posted March 29, 2003 Veteran Share Posted March 29, 2003 mysql_num_rows() ? Link to comment Share on other sites More sharing options...
0 Rusty.Metal Posted March 30, 2003 Author Share Posted March 30, 2003 K but how can i make it only count the ones with DownloadType row = wallpaper Link to comment Share on other sites More sharing options...
0 WDZ Posted March 30, 2003 Share Posted March 30, 2003 $result = mysql_query("SELECT * FROM downloads WHERE DownloadType='wallpaper'"); $count = mysql_num_rows($result); Link to comment Share on other sites More sharing options...
0 eXplosive Posted March 30, 2003 Share Posted March 30, 2003 This is a lot faster. $sql = "SELECT COUNT(*) FROM table_name WHERE DownloadType='wallpaper'"; $result = mysql_query($sql); $count = mysql_result($result, 0); Link to comment Share on other sites More sharing options...
0 Tim Dorr Veteran Posted March 30, 2003 Veteran Share Posted March 30, 2003 Topic edited for spelling... - timdorr heavy moderating industries Link to comment Share on other sites More sharing options...
0 giantsnyy2002 Posted March 30, 2003 Share Posted March 30, 2003 Topic edited for spelling... - timdorr heavy moderating industries and its still spelled wrong timdorr... its Entries not Entrys Link to comment Share on other sites More sharing options...
0 Tim Dorr Veteran Posted March 30, 2003 Veteran Share Posted March 30, 2003 arg! I are dumb! Link to comment Share on other sites More sharing options...
Question
Rusty.Metal
How can i make a script count the number of entries, that have "wallpapers" in the Type row.. a table so like in a download script it would show how meany files i have
Edited by aaronsamLink to comment
Share on other sites
7 answers to this question
Recommended Posts