i want to echo an array on json format but without labels, only with values.
i have this backsearch.php
<?php
// if the 'term' variable is not sent with the request, exit
if ( !isset($_REQUEST['term']) )
exit;
$data = array();
$con=mysql_connect("localhost","root","");
$db=mysql_select_db("Fw.To",$con);
$rs=mysql_query('select * from Users where Owner LIKE "'. mysql_real_escape_string($_REQUEST['term']) .'%"', $db);
if ( $rs && mysql_num_rows($rs) )
{
while( $row = mysql_fetch_array($rs, MYSQL_ASSOC) )
{
array_push($data, $row['Owner']);
}
}
echo json_encode($data);
flush();
?>
and this javascript-jquery inside on my html where it wait the only value json
<script>
jQuery(document).ready(function($){
$('#search').autocomplete({source: 'backsearch.php'});
});
</script>
Any idea?
EDIT: i want to take ["red","blue","yellow"] for give it on javascript and no {"0":red,"1":blue,"3":yellow}