I am displaying data from database using PHP. I am using JSON. but during result, I got unwanted array. This is sample:
while($row = mysql_fetch_array($result))
{
echo "<pre>"; print_r($row); echo "</pre>";
//$output[]=$row;
}
Output:
Array
(
[0] => Ravi Ad
[title] => Ravi Ad
)
Here I saw , a extra column is displaying name [0]. i hate it and making problem in parsing . May any once can remove it ?
i am trying this result:-
Array
(
[title] => Ravi Ad
)
thank you
try
mysql_fetch_assocNOTE : mysql_* is deprectaed in new version of php use mysqli or PDO
ref: http://php.net/manual/en/function.mysql-fetch-array.php