-
search in all tables
hi guys me again this is what i have
PHP Code:
$result = mysql_query("SELECT * FROM table WHERE firstname LIKE '%".$searchterm."%'");
which works just great BUT if i want to seach
PHP Code:
$result = mysql_query("SELECT * FROM table WHERE lastname LIKE '%".$searchterm."%'");
how so search ALL rows/columns firstname,lastname,username ect
P.S i'm getting it slowly lol
-
It looks like you want to search through multiple columns in one table as opposed to searching through multiple tables, but let me know if I am wrong.
Try this
Code:
SELECT * FROM table WHERE (lcase(concat(firstname, lastname, username)) LIKE '%$searchterm%')
-
you are correct THANK YOU
-