Forums

This topic is locked

help required with an SQL statement

Posted 14 Jan 2004 23:39:11
1
has voted
14 Jan 2004 23:39:11 Paul Brown posted:
HI

Using the 'simple' mode recordset builder the following works....

SELECT id, title, date_posted
FROM news
WHERE newkeywords LIKE '%colname%'

But when I go into advanced mode and try and do the following...

SELECT id, title, date_posted
FROM news
WHERE newkeywords LIKE '%colname%' or title LIKE '%colname%' or details LIKE '%colname%'

...it always just returns the first record in recordset.

What am I doing wrong???

Many Thanks

Paul Brown

Replies

Replied 15 Jan 2004 01:33:19
15 Jan 2004 01:33:19 Dave Thomas replied:
is %colname% a form input box by any chance?

are you declaring the %colname% in the advanced box with a run-time value etc..?

Regards,
Dave

[DWMX 2004] | [FlashMX 2004 Pro]|[Studio MX 2004]|[SQL]|[Access2000/2002]|[ASP/VBScript]|[XP-Pro]
Replied 16 Jan 2004 11:37:42
16 Jan 2004 11:37:42 Paul Brown replied:
In the advanced box I had...

Name - colname
Default Value - 1
Run Time Value - $_GET['imgquery']

Is there any error above?

Cheers

Paul

Reply to this topic