Page 1 of 1

is this sql correct?

Posted: Fri Oct 24, 2003 4:32 am
by phil speakman
i'm using this to do a searchable mySql database

Code: Select all

$query = "select * from alt_bridge_pupils where pupil like '$name'";
and it doesn't output anything - i know name holds a value that is in database, any thoughts
Phil

Posted: Fri Oct 24, 2003 5:19 am
by devork
try this

Code: Select all

$query = "select * from alt_bridge_pupils where pupil like '%$name%' ";

cheers

Posted: Fri Oct 24, 2003 5:44 am
by phil speakman
who ever you are i want you babies....

Re: cheers

Posted: Fri Oct 24, 2003 10:24 am
by devork
phil speakman wrote:who ever you are i want you babies....
was that related to query :roll: