currently I’ve written a code and it works fine with only keyword. Also, it doesn’t take care of multiple entries. for example, if I have the keyword “blue” twice in DB; it shows “blue” twice in the search input box when I start typing “blue”. Rest of the code works fine. How should I tweak my code? Also, if a column has “blue” & “green” as the row; it shows the complete thing: “blue & green”. My php code:
<?php
$keyword = mysql_real_escape_string($_POST['keywords']);
$sql = "SELECT * FROM job WHERE work='$keyword' or work LIKE 'ANOTHER_PARAMETER' LIMIT 5";
$result = mysql_query($sql);
$numrows = mysql_num_rows($result);
echo //details and run the loop
?>
You can try modifying your SQL DB. You can have a column of “work_ids” and another for “work corresponding to those ids”.
Sorry, I left a part of your question unanswered but thanks to @T-shirt Dude; I remebered it instantly. If I am reading your question right, you want to search for multiple keywords in a single column? If so you can do:
$sql = mysql_query("SELECT work_id, work FROM jobWHERE work like '%$q%' OR work like 'ANOTHER_PARAMETER'
ORDER BY work_id LIMIT 10");
You can put as many “OR”s that you want.