Re: [PHP] OK SQL experts...

2004-04-25 Thread Daniel Clark
The parenthesis are OK. The query might take a long time to run with 3 LIKE statements. >>Backticks, single quotes, or nothing at all makes no difference. I >>believe the parsing error is due to my parentheses or AND/OR structure. >>Any thoughts on that? >> >> >> >>On Apr 23, 2004, at 8:32 A

Re: [PHP] OK SQL experts...

2004-04-25 Thread Daniel Clark
I think you want to remove the single quotes around the field names. SELECT * FROM my_table WHERE (field_1 LIKE '%$keyword%' OR field_2 LIKE '%$keyword%' OR field_3 LIKE '%$keyword%') AND status = 'active'; >>I STFW and RTFM and I still can't figure out why this returns a 1064 >>parse error:

Re: [PHP] OK SQL experts...

2004-04-23 Thread John Nichel
Brian Dunning wrote: On Apr 23, 2004, at 10:13 AM, John Nichel wrote: Brian Dunning wrote: I STFW and RTFM and I still can't figure out why this returns a 1064 parse error: SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%')

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''my_table' WHERE ('field_1' LIKE '%%' OR 'field2' Because you are using a single quotes around your table/field names. Remove them or use ` (back tick). As sugges

Re: [PHP] OK SQL experts...

2004-04-23 Thread John W. Holmes
From: "Brian Dunning" <[EMAIL PROTECTED]> > My error. Here is the actual return: > > You have an error in your SQL syntax. Check the manual that corresponds > to your MySQL server version for the right syntax to use near > ''my_table' WHERE ('field_1' LIKE '%custom%' OR 'field_ > > I am searching f

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''my_table' WHERE ('field_1' LIKE '%%' OR 'field2' Because you are using a single quotes around your table/field names. Remove them or use ` (back tick). As sugges

Re[2]: [PHP] OK SQL experts...

2004-04-23 Thread Richard Davey
Hello Brian, Friday, April 23, 2004, 6:18:43 PM, you wrote: BD> You have an error in your SQL syntax. Check the manual that corresponds BD> to your MySQL server version for the right syntax to use near BD> ''my_table' WHERE ('field_1' LIKE '%%' OR 'field2' my_table should NOT be quoted in this

Re: [PHP] OK SQL experts...

2004-04-23 Thread Curt Zirzow
* Thus wrote Brian Dunning ([EMAIL PROTECTED]): > > On Apr 23, 2004, at 10:13 AM, John Nichel wrote: > > >Brian Dunning wrote: > >>I STFW and RTFM and I still can't figure out why this returns a 1064 > >>parse error: > >>SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR > >>'field_

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
On Apr 23, 2004, at 10:27 AM, Edward Peloke wrote: doesn't look like your $keyword value contains anything. My error. Here is the actual return: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''my_table' WHER

RE: [PHP] OK SQL experts...

2004-04-23 Thread Edward Peloke
doesn't look like your $keyword value contains anything. -Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Friday, April 23, 2004 1:19 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] OK SQL experts... On Apr 23, 2004, at 10:13 AM, John Nichel wrote: > Brian

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
On Apr 23, 2004, at 10:13 AM, John Nichel wrote: Brian Dunning wrote: I STFW and RTFM and I still can't figure out why this returns a 1064 parse error: SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 'status' = 'acti

Re: [PHP] OK SQL experts...

2004-04-23 Thread John Nichel
Brian Dunning wrote: I STFW and RTFM and I still can't figure out why this returns a 1064 parse error: SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 'status' = 'active'; Anyone? TIA! - B1ff Lamer What does mysql_

Re: [PHP] OK SQL experts...

2004-04-23 Thread Curt Zirzow
* Thus wrote Brian Dunning ([EMAIL PROTECTED]): > I STFW and RTFM and I still can't figure out why this returns a 1064 > parse error: > > SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR > 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND > 'status' = 'active'; You

Re: [PHP] OK SQL experts...

2004-04-23 Thread William Lovaton
How are you manipulating the whole SQL string?? $sql = "SELECT..."; ??? or $sql = 'SELECT...'; ??? In this case you will have to use double quotes because PHP won't parse single quote strings for searching embedded PHP variables. May be this is the problem. -William El vie, 23-04-2004 a

Re[2]: [PHP] OK SQL experts...

2004-04-23 Thread Richard Davey
Hello Brian, Friday, April 23, 2004, 5:02:00 PM, you wrote: BD> Yes, I actually did exactly that. Everything works until I have more BD> than one statement inside the (x LIKE x OR x LIKE x) parens. That's why BD> I figured there has to be something wrong with my paren structure. When BD> I RTFM I

Re[4]: [PHP] OK SQL experts...

2004-04-23 Thread Tom Rogers
Hi, Saturday, April 24, 2004, 2:03:36 AM, you wrote: JB> [snip] JB> They do if they are themselves inside double quotes :) JB> echo "'$var'"; will get parsed ok JB> [/snip] JB> I know, but since I saw no double quotes I had to go for the obvious. :) Yes I would like to see the "whole truth" as

RE: Re[2]: [PHP] OK SQL experts...

2004-04-23 Thread Jay Blanchard
[snip] They do if they are themselves inside double quotes :) echo "'$var'"; will get parsed ok [/snip] I know, but since I saw no double quotes I had to go for the obvious. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
if that works move up into: SELECT * FROM my_table WHERE (field_1 LIKE '%$keyword%') AND status = 'active'; Yes, I actually did exactly that. Everything works until I have more than one statement inside the (x LIKE x OR x LIKE x) parens. That's why I figured there has to be something wrong with m

Re[2]: [PHP] OK SQL experts...

2004-04-23 Thread Tom Rogers
Hi, Saturday, April 24, 2004, 1:55:36 AM, you wrote: JB> [snip] JB> SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR JB> 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND JB> 'status' = 'active'; JB> [/snip] JB> *slaps forehead* JB> "SELECT * FROM my_table WHERE (fi

RE: [PHP] OK SQL experts...

2004-04-23 Thread Jay Blanchard
[snip] SELECT * FROM my_table WHERE (field_1 LIKE '%$keyword%') AND status = 'active'; if that works continue until you get an error. [/snip] That'll give you an error right there. That old single quoted variable will get you every time. :) WHERE (field_1 LIKE '%$keyword%') WHERE (field_1 LIKE

RE: [PHP] OK SQL experts...

2004-04-23 Thread Chris W. Parker
Brian Dunning on Friday, April 23, 2004 8:19 AM said: > SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR > 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND > 'status' = 'active'; have you tried simply: SELECT * FROM my_table WHERE statu

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
ng put in the $keyword variable? You are sure all these columns exist? -Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Friday, April 23, 2004 11:36 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] OK SQL experts... Backticks, single quotes, or nothing at all makes no di

RE: [PHP] OK SQL experts...

2004-04-23 Thread Jay Blanchard
[snip] SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 'status' = 'active'; [/snip] *slaps forehead* "SELECT * FROM my_table WHERE (field_1 LIKE '%" . $keyword . "%' OR field_2 LIKE '%" . $keyword . "%' OR field_3 L

RE: [PHP] OK SQL experts...

2004-04-23 Thread Daniel Purdy
>>> I STFW and RTFM and I still can't figure out why this returns a 1064 >>> parse error: >>> >>> SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR >>> 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND >>> 'status' = 'active'; Why don't you try rebuilding the query. I

Re: [PHP] OK SQL experts...

2004-04-23 Thread Mark
> these > > columns exist? > > > > -Original Message- > > From: Brian Dunning [mailto:[EMAIL PROTECTED] > > Sent: Friday, April 23, 2004 11:36 AM > > To: [EMAIL PROTECTED] > > Subject: Re: [PHP] OK SQL experts... > > > > > > Backticks,

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
MAIL PROTECTED] Subject: Re: [PHP] OK SQL experts... Backticks, single quotes, or nothing at all makes no difference. I believe the parsing error is due to my parentheses or AND/OR structure. Any thoughts on that? On Apr 23, 2004, at 8:32 AM, John W. Holmes wrote: From: "Brian Dunning

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
--Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Friday, April 23, 2004 11:36 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] OK SQL experts... Backticks, single quotes, or nothing at all makes no difference. I believe the parsing error is due to my parentheses or AND/OR stru

RE: [PHP] OK SQL experts...

2004-04-23 Thread Edward Peloke
if you echo out the query..what is the output? -Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Friday, April 23, 2004 11:36 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] OK SQL experts... Backticks, single quotes, or nothing at all makes no difference. I believe

RE: [PHP] OK SQL experts...

2004-04-23 Thread Edward Peloke
what value is being put in the $keyword variable? You are sure all these columns exist? -Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Friday, April 23, 2004 11:36 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] OK SQL experts... Backticks, single quotes, or nothing

RE: [PHP] OK SQL experts...

2004-04-23 Thread Jay Blanchard
[snip] SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 'status' = 'active'; [/snip] How about this? SELECT * FROM my_table WHERE (field_1 LIKE '%$keyword%' OR field_2 LIKE '%$keyword%' OR field_3 LIKE '%$keyword%')

RE: [PHP] OK SQL experts...

2004-04-23 Thread Jeff McKeon
rd%' && status = 'active' Jeff > -Original Message- > From: Brian Dunning [mailto:[EMAIL PROTECTED] > Sent: Friday, April 23, 2004 11:30 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] OK SQL experts... > > > It gives

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
Backticks, single quotes, or nothing at all makes no difference. I believe the parsing error is due to my parentheses or AND/OR structure. Any thoughts on that? On Apr 23, 2004, at 8:32 AM, John W. Holmes wrote: From: "Brian Dunning" <[EMAIL PROTECTED]> I STFW and RTFM and I still can't figu

Re: [PHP] OK SQL experts...

2004-04-23 Thread John W. Holmes
From: "Brian Dunning" <[EMAIL PROTECTED]> > I STFW and RTFM and I still can't figure out why this returns a 1064 > parse error: > > SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR > 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND > 'status' = 'active'; Use backt

Re: [PHP] OK SQL experts...

2004-04-23 Thread Richard Harb
gured what the hell)... > On Apr 23, 2004, at 8:27 AM, Edward Peloke wrote: >> why are the table and field names surrounded by single quotes? >> >> -Original Message- >> From: Brian Dunning [mailto:[EMAIL PROTECTED] >> Sent: Friday, April 23, 2004 11:19 A

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
] Sent: Friday, April 23, 2004 11:23 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] OK SQL experts... I tried it both ways - didn't make any difference (phpmyadmin adds the single quotes when I was trying to use its sql function to debug, so I figured what the hell)... On Apr 23, 2004, at 8:

RE: [PHP] OK SQL experts...

2004-04-23 Thread Edward Peloke
does it just return the error when running in the php page? If you pull it out can you run it in mysql without errors? -Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Friday, April 23, 2004 11:23 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] OK SQL experts... I

RE: [PHP] OK SQL experts...

2004-04-23 Thread Jay Blanchard
[snip] I tried it both ways - didn't make any difference (phpmyadmin adds the single quotes when I was trying to use its sql function to debug, so I figured what the hell)... [/snip] Those aren't single quotes it adds to table and column names...those are back tics (on the same key as the tilde)

Re: [PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
uotes? -Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Friday, April 23, 2004 11:19 AM To: [EMAIL PROTECTED] Subject: [PHP] OK SQL experts... I STFW and RTFM and I still can't figure out why this returns a 1064 parse error: SELECT * FROM 'my_table' WHERE ('fiel

RE: [PHP] OK SQL experts...

2004-04-23 Thread Edward Peloke
why are the table and field names surrounded by single quotes? -Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Friday, April 23, 2004 11:19 AM To: [EMAIL PROTECTED] Subject: [PHP] OK SQL experts... I STFW and RTFM and I still can't figure out why this retu

[PHP] OK SQL experts...

2004-04-23 Thread Brian Dunning
I STFW and RTFM and I still can't figure out why this returns a 1064 parse error: SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 'status' = 'active'; Anyone? TIA! - B1ff Lamer -- PHP General Mailing List (http://