Friday, January 22, 2016

PHP MYSQL: Search Multiple Columns Using Like

I had encountered searching multiple columns using a single input control, a textbox. That is searching from a last name and first name column using any of the two. So I have here the code to do that.
Table

STUDENT


MySQL Code
SELECT * FROM `student` WHERE CONCAT(stud_first,stud_last) like "%ua%"

The query above will search for first name or last name with "ua".

Output





PHP MYSQL: Search Multiple Columns Using Like

PHP MYSQL: Search Multiple Columns Using Like Rating: 4.5 Diposkan Oleh: Emoblazz

0 comments:

Post a Comment