php - filter json results based on value with url -
i running mysql query in php file , parsing json follow:
$json_response = array(); while ($row = mysql_fetch_array($result, mysql_assoc)) { $row_array['artist'] = $row['artist']; $row_array['song'] = $row['song']; //push values in array array_push($json_response,$row_array); } echo json_encode($json_response);
there thousands of entries; there way can filter json results based on value? like: mylink.php/artist1 or mylink.php?artist=1
i appreciate sort of ideas.
thanks
you can so:
// artist info $artist_id = isset($_get['artist']) ? intval($_get['artist']) : 0; $sql = "select * artist"; if($artist_id) $sql .= " artist=$artist_id"; mysql_query($sql);
Comments
Post a Comment