$select_data =  “SELECT MAX(vendor_brand_code)  FROM    tbl_vendor_brand;”;

$query_data = mysql_db_query($db_name, $select_data);

$result_data = mysql_fetch_array($query_data);

$vendor_brand_code  = $result_data[“MAX(vendor_brand_code)“];

 

Note :

MAX(vendor_brand_code) harus sama pada $select_data dan $vendor_brand_code.

 

Sumber : Anonymous