I am trying to fetch the data from table and store it in the array named "items" and then access it using index. I am getting an error "Undefined offset: 0" . What is wrong in the code ?
$i=0;
while($row = mysql_fetch_array($sqlquery))
{
$name = $row['name'];
$items = array();
$items[$i] = $name;
$i= $i +1;
}
echo $items[0];
echo $items[1];