I need to search in the hostel table .
structure:
CREATE TABLE hostel(
p_id VARCHAR(5) NOT NULL,
hostel VARCHAR(50) NOT NULL,
address VARCHAR(50) NOT NULL
PRIMARY KEY(p_id));
I have inserted searched word in $word
select * from hostel where hostel like '%$word%'
Will below query work? I need to search in both “hostel” and “address” column
select * from hostel where hostel like '%$word%' AND address like '%$word%'
will bring better results