i have problem in searching concat values,
is there any ways using “mysql query” or “php algorithm” ??
my idea is,, i have four column to combine (concate) as ID field and NAME field.
using this two field, actualy i have an input text to use for searching this two field (ID and NAME)
i have query like this but this doesn’t work (because of this line: id like ‘%$search%’)
select
concat(
id_1, '.',
id_2, '.',
id_3, '.',
id_4
)
as id,
name
from
employee
where
id like '%$search%'
or name like '%$search%'
“id” hasn’t been prepared yet when the WHERE clause is applied
So use a derived table:
or repeat the expression