Jump to content

Archived

This topic is now archived and is closed to further replies.

crzyman

Find the largest number in a column

Recommended Posts

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>";

 

}

?>

Share this post


Link to post
Share on other sites

it would help if you posted any error message or is it simply not giving the result?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.