Jump to content

Get max from SQl and echo out


petenaylor

Recommended Posts

Hi all

 

I am trying to get the contents from an array using the below SQL query:

 

$sql = mysql_query ("SELECT MAX (postage_world) FROM `basket` ");

while ($row = mysql_fetch_array($sql)) {

    echo $row["id"];

    echo $row["description"];

    echo $row["postage_world"];

}

 

I need the SQL query to find the highest value from the table and then echo out the results. The error I get is

 

"Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given"

 

Many thanks for your help!

 

 

Link to comment
https://forums.phpfreaks.com/topic/231583-get-max-from-sql-and-echo-out/
Share on other sites

Archived

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

×
×
  • Create New...

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.