I have a problem. I'm building a Client Information System with PHP and MYSQL. One of the feature of the application is to allow users to search for the name by typing ic number in multiple input. For example, information stored in the database:
ID : 1
NAME : John
IC : 111
ID : 2
NAME : James
IC : 222
ID : 3
NAME : Sarah
IC : 333
So, to search the data, in search field (form), i would like to type 111222 , without comma. so is there any ways? Any sql syntax which should i use?
Any help is very much appreciated
EDITED
Here is my code for searching function.
$ics = $_POST["nokp"];
$each =explode(' ',$ics);
$q=mysql_query("SELECT id,nama,nokp from client where nokp in(". implode(',', $each).") group by nama,nokp");
Aucun commentaire:
Enregistrer un commentaire