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
$sql1 = "titulo like '%$titulotxt%'"
$sql2 = "cd like '$cdstxt'";
$sql = "SELECT * FROM divx WHERE $sql1 AND $sql2 ORDER BY titulo";
I think you are getting the error because of the ($titulotxt) ? portion of
your sql statements. You really only need the two statements listed above
and then put in
> 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=(
5 matches
Mail list logo