when I run the method:
public function latest_idf() {
global $database;
$sql = "SELECT FROM ".self::$table_name;
$result_id=($database->query($sql));
return ($result_id);
}
the variable $result_id returns resource (11) of type ("mysql result") or Resource id #5
which I need to parse to integer for max id number, how can I return the $result_id
as a number integer ?
Resource id #5 it is not my max row.
I have 6 row and in my table.
Did max(id) is beginning from 0 to 5 ?
Resource id #5indicates that your query() method actually returns a “pointer” to your result, not the result itself.Depending on the library you use in background to access mysql you need to retrieve the data from this resource. If your are using the mysql_* functions that would be done for example by using: