Re: [PHP] Newbie: PHP/MySQL (SELECT)

2002-11-22 Thread Marek Kilimajer
if one of $titulotxt or $cdstxt is not set, your query will look something like this: SELECT * FROM divx WHERE && cds like '$cdstxt' ORDER BY titulo As you see, there is unnecessery &&. I build my search queries using this form: $query_cond=''; foreach($_GET as $col => $val) { switch($col)

Re: [PHP] Newbie: php/mysql (Select)

2002-11-20 Thread Ernest E Vogelsinger
At 20:23 20.11.2002, Mr. BuNgL3 said: [snip] >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 '%".$tit

RE: [PHP] Newbie: PHP/MySQL (SELECT)

2002-11-20 Thread Van Andel, Robert
need the two statements listed above and then put into your actual sql statement. Robbert van Andel -Original Message- From: Mr. BuNgL3 [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 20, 2002 11:54 AM To: [EMAIL PROTECTED] Subject: [PHP] Newbie: PHP/MySQL (SELECT) Hi... I'm

Re: [PHP] Newbie: PHP/MySQL (SELECT)

2002-11-20 Thread DL Neil
> 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."%'":

Re: [PHP] Newbie: PHP/MySQL (SELECT)

2002-11-20 Thread Jason Wong
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=(

[PHP] Newbie: PHP/MySQL (SELECT)

2002-11-20 Thread Mr. BuNgL3
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

[PHP] Newbie: php/mysql (Select)

2002-11-20 Thread Mr. BuNgL3
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