searching all fields in mysql database
Posted: Mon Nov 16, 2009 11:50 am
Hi there, hoping someone can help me.
Ive got my database and I want to be able to search all fields in a certain table.
Ive got code that can retrieve data from one specific table field, but I need it to be able to search through ALL of the fields in my table and then use an array to list the data.
Im not going to include all the code as Im hoping its just these snippets.
this gets the variable from the previous form
$var = @$_GET['q'] ;
$trimmed = trim($var);
and this bit is the mysql query
$query = "select * from listed_properties where county like \"%$trimmed%\"
order by county"
Ive got my database and I want to be able to search all fields in a certain table.
Ive got code that can retrieve data from one specific table field, but I need it to be able to search through ALL of the fields in my table and then use an array to list the data.
Im not going to include all the code as Im hoping its just these snippets.
this gets the variable from the previous form
$var = @$_GET['q'] ;
$trimmed = trim($var);
and this bit is the mysql query
$query = "select * from listed_properties where county like \"%$trimmed%\"
order by county"