I have this mysql query that I would like to make mysqli compatible and in the same time more efficient? Thanks a lot in advance!
My code is
$query = "SELECT COUNT(*) as num FROM table";
$total_pages = mysql_fetch_array(mysql_query($query));
$total_pages = $total_pages[num];
$limit = 15;
$start = 0;
$sql = mysql_query("SELECT * FROM table ORDER BY id DESC LIMIT $start, $limit") or die(mysql_error());