On Thursday 21 November 2002 03:53, Mr. BuNgL3 wrote: > Hi... > I'm with a little sintax problem... > The question is that i have two search fields (titulotxt and cdstxt) and i > want to create an mysql condition... i trying: > > $sql1=($titulotxt) ? "titulo like '%".$titulotxt."%'":""; > $sql2=($cdstxt) ? "cds like '$cdstxt'":""; > $sql="SELECT * FROM divx WHERE" .$sql1 " && " .$sql2 " ORDER BY titulo"; > > but he's giving me a sintax error on the 3 line... Can anyone > teach me how i must do to validate the mysql condition and make it work?
Try: $sql="SELECT * FROM divx WHERE" .$sql1. " && " .$sql2. " ORDER BY titulo"; -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* He thinks by infection, catching an opinion like a cold. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php