I'm trying to retrieve some data from the MySql table. But when I run the query, It showing Notice : Undefined index: id. But when I run the same query in SQLyog it is showing the correct result. Without any error.
Query :
SELECT id,temp_name,added,updated FROM `projtemp` WHERE `user_id`='0000000001'
Out from SQLyog :
Error From Firebug Console :
<b>Notice</b>: Undefined index: id in <b>C:\xampp\htdocs\xxx\yyy\zzz\aaa.php</b> on line <b>61</b><br />
Php Code which I executed :
try {
$paginate = new pagination($page, "SELECT id,temp_name,added,updated FROM `projtemp` WHERE `user_id`='$uid'", $options);
} catch (paginationException $e) {
echo $e;
exit();
}
Update :
if ($paginate->success == true) {
while ($row = $result->fetch_assoc()) {
$temp=array();
$temp['id']=$row['id']; // In this line I'm Getting Error Line-61
$temp['tname'] = $row['temp_name'];
$temp['added'] = $row['added'];
if ($row['updated'] == '') {
$temp['updated'] = 'Never';
} else {
$temp['updated'] = $row['updated'];
}
$data['data']=$temp;
}
Please any one help me to solve this issue....