February 25, 201016 yr Hi, I've got Sphinx search installed and running properly in linux, but I'm having trouble with the mysql coding. The folowing php code is only returning the first result in the array: ----- $ids=implode(',', array_keys($res['matches'])); $result=mysql_query("SELECT * FROM items WHERE id = '$ids'"); while($row=mysql_fetch_array($result)) { echo $row['ItemTitle'] . "<br>"; echo $row['ItemDescription'] . "<br>"; } ----- $res is the array returned from sphinx with 'matches' being the list of ids I want to use. Does anyone have any experiance with sphinx/mysql that could help me out?
February 26, 201016 yr Author Fixed, the problem was: SELECT * FROM items WHERE id = '$ids' Should have been: SELECT * FROM items WHERE id IN ($ids)
Create an account or sign in to comment