crzyman Posted September 8, 2005 Share Posted September 8, 2005 I need to find out the largest number in a column and I thought this would work. What could I be doing wrong? Thanks for your help. <? mysql_connect("localhost","name","pass"); mysql_select_db("MyDatabase"); $result = mysql_query("SELECT MAX(count_visits) FROM artist"); //grab all the content while($r=mysql_fetch_array($result)) { $profile_views=$r["count_visits"]; //display the row echo "<FONT size=2><center><font color=#000000>Profile Views: $profile_views</font></center>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/2493-find-the-largest-number-in-a-column/ Share on other sites More sharing options...
OLG Posted September 8, 2005 Share Posted September 8, 2005 it would help if you posted any error message or is it simply not giving the result? Quote Link to comment https://forums.phpfreaks.com/topic/2493-find-the-largest-number-in-a-column/#findComment-8278 Share on other sites More sharing options...
crzyman Posted September 9, 2005 Author Share Posted September 9, 2005 it would help if you posted any error message or is it simply not giving the result? 275909[/snapback] It wasn't giving a result. I now have it working. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/2493-find-the-largest-number-in-a-column/#findComment-8279 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.