<?php
include '../connection.php';
$sql="SELECT userid,name,batch FROM dbusers";
$results=mysql_query($sql) or die("Cannot execute query");
$count=mysql_num_rows($results);
$arr=array();
for($i=0; $i < $count; $i++){
$rows=mysql_fetch_array($results);
//What to put here ?
}
json_encode($arr);
?>
This is my php code. I want to ask what to put inside the for loop so that I can create a an array of array in php. The inner array will have userid, name and batch as its elements .