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)
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
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
> 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."%'":
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=(
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
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
7 matches
Mail list logo