Můžete zkusit toto:
//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
}
Během smyčky while jsem použil konstantu MYSQLI_BOTH, ale můžete ji změnit na MYSQLI_NUM nebo MYSQLI_ASSOC podle toho, co potřebujete.