Puoi provare questo:
//Establish connection using mysqli api
$conn = mysqli_connect('hostname', 'username', 'password', 'database_name');
$sql = "SELECT SQL_CALC_FOUND_ROWS *, post.id as pid, bla bla FROM account ORDER BY pid ASC". $eb["array"]['querylimit'];
$sql2 = "SELECT FOUND_ROWS()";
$result1 = $conn->query($sql);
$result2 = $conn->query($sql2);
$TotalRcount = $result2->fetch_row();
// Performing record count [current]
// $RecordCount = $result->num_rows();
while($row = $result->fetch_array(MYSQLI_BOTH)){
// read columns
}
In un ciclo di tempo ho usato la costante MYSQLI_BOTH ma puoi cambiarla in MYSQLI_NUM o MYSQLI_ASSOC a seconda delle tue esigenze.