Hi All, I Have Some Problem with my PHP Searching Code... I Want to Create Hyperlink of Multipul Data for Ex. :- a user Found example if this query have maney data this show as hyperlink view....
i am using this code.......
//Set the MySQL query if ($search == NULL or $search == '%'){ } else { for ($i=0; $i<count($keywords); $i++) { $query = "SELECT * FROM table " . "WHERE Roll_No LIKE '%".$keywords[$i]."%'". " OR Name LIKE '%".$keywords[$i]."%'" . " ORDER BY Roll_No"; }you can find this query on [link]www.kuchamancity.com/8thResult.php[/link] plz enter 10000 to display result but when i enter Hemant it does not display any result.. because hemant query having 2 Data....... plz help me........
Here is one solution:[code]
I Have Some Problem with my PHP Searching Code...
I Want to Create Hyperlink of Multipul Data for Ex. :- a user Found example if this query have maney data this show as hyperlink view....
i am using this code.......
//Set the MySQL query
if ($search == NULL or $search == '%'){
} else {
$where_addin = ''; //this will be the added WHERE statement
for ($i=0; $i<count($keywords); $i++) {
if ($i == 0) { //no OR if its the first variable
$where_addin .= "WHERE Roll_No LIKE '%".$keywords[$i]."%'"." OR Name LIKE '%".$keywords[$i]."%' ";
} else {
$where_addin .= "OR Roll_No LIKE '%".$keywords[$i]."%'"." OR Name LIKE '%".$keywords[$i]."%' ";
}
$query = "SELECT * FROM table
$where_addin
ORDER BY Roll_No";