On 3 Apr, 14:42, "Jerim79" <com> wrote:
I just copied and pasted that query into phpmyadmin and it ran
perfectly version 5.1.16
I am running MySQL 4.0.1. I can run this query fine: SELECT * FROM form WHERE Email="com" This query doesn't work: SELECT * FROM form WHERE Email="com" AND Name="Name" It only tells me that there is an error in my syntax near Name="Name", and to check the manual for the proper syntax. I have tried && instead of AND. I have checked the official manual, but it had nothing new to offer. I even tried some of the examples for version 5, just in case....
I am running MySQL 4.0.1. I can run this query fine: SELECT * FROM
form WHERE Email="com"
This query doesn't work: SELECT * FROM form WHERE
Email="com" AND Name="Name"
It only tells me that there is an error in my syntax near Name="Name",
and to check the manual for the proper syntax. I have tried && instead
of AND. I have checked the official manual, but it had nothing new to
offer. I even tried some of the examples for version 5, just in case.
On 3 Apr, 14:42, "Jerim79" <com> wrote:
I just copied and pasted that query into phpmyadmin and it ran
perfectly version 5.1.16
On Apr 3, 9:06 am, "Captain Paralytic" <com> wrote:
>
>
>
> I just copied and pasted that query into phpmyadmin and it ran
> perfectly version 5.1.16[/ref]
I appreciate your response, but that doesn't exactly fix my problem
unless you are going to let me come over and use your computer. Any
alternative ways to do this? I have tried AND and &&. I even tried
using a comma.
On 3 Apr, 15:50, "Jerim79" <com> wrote:
> [/ref]
> [/ref]
> [/ref]
>
>
> I appreciate your response, but that doesn't exactly fix my problem
> unless you are going to let me come over and use your computer. Any
> alternative ways to do this? I have tried AND and &&. I even tried
> using a comma.[/ref]
What I'm saying is that there isn't a syntax error per se.
One good idea is to quote all non keywords with back ticks thus:
SELECT * FROM `form` WHERE
`Email`="com" AND `Name`="Name"
Also, what do you get if you try:
SELECT * FROM `form` WHERE
`Name`="Name"
or
SELECT * FROM `form` WHERE
`Name`="Name" AND `Email`="com"
On Apr 3, 10:59 am, Jerry Stuckle <net> wrote: [/ref]
> [/ref]
>
>
> Perhaps that isn't your problem. Is this in an application? If so,
> what's the entire code you're using - not just the SELECT statement?
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> net
> ==================[/ref]
SELECT * FROM `form` WHERE Email='$Email' AND Show='$Show'
Now, before we go assuming it is a PHP issue, this statement works
perfectly fine:
SELECT * FROM `form` WHERE Email='$Email'
On 3 Apr, 16:25, "Jerim79" <com> wrote: [/ref]
> [/ref]
> [/ref]
>
>
>
> SELECT * FROM `form` WHERE Email='$Email' AND Show='$Show'
>
> Now, before we go assuming it is a PHP issue, this statement works
> perfectly fine:
> SELECT * FROM `form` WHERE Email='$Email'
>
> - Show quoted text -[/ref]
That tells us no more than the first post. Please answer the questions
in my other post.
On 3 Apr 2007 08:25:40 -0700, Jerim79 wrote:
>>
>>
>>
>> Perhaps that isn't your problem. Is this in an application? If so,
>> what's the entire code you're using - not just the SELECT statement?[/ref]
>
> SELECT * FROM `form` WHERE Email='$Email' AND Show='$Show'
>
> Now, before we go assuming it is a PHP issue, this statement works
> perfectly fine:
> SELECT * FROM `form` WHERE Email='$Email'[/ref]
Jerry asked for the surrounding code, not just the select. I semll a
quoting issue. Build your select into a single string variable first so
you can get the fully-expanded SQL out someplace where you can look at
it. like
$qry = "SELECT * FROM `form` WHERE Email='$Email' AND Show='$Show'";
print "$qry\n";
--
When you have a thermic lance, everything looks like hours of fun.
-- Christian Wagner in a.s.r
On Apr 3, 10:38 am, "Captain Paralytic" <com>
wrote:
> [/ref]
> [/ref]
> [/ref]
> [/ref]
> [/ref]
>
>
>
>
> That tells us no more than the first post. Please answer the questions
> in my other post.[/ref]
I get the exact same results. The query works 100% with or without the
` marks, up until AND.
Jerim79 wrote:
>> I just copied and pasted that query into phpmyadmin and it ran
>> perfectly version 5.1.16[/ref]
>
> I appreciate your response, but that doesn't exactly fix my problem
> unless you are going to let me come over and use your computer. Any
> alternative ways to do this? I have tried AND and &&. I even tried
> using a comma.
>[/ref]
Perhaps that isn't your problem. Is this in an application? If so,
what's the entire code you're using - not just the SELECT statement?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
net
==================
Jerim79 wrote:
>> Perhaps that isn't your problem. Is this in an application? If so,
>> what's the entire code you're using - not just the SELECT statement?
>>
>> --
>> ==================
>> Remove the "x" from my email address
>> Jerry Stuckle
>> JDS Computer Training Corp.
>> net
>> ==================[/ref]
>
> SELECT * FROM `form` WHERE Email='$Email' AND Show='$Show'
>
> Now, before we go assuming it is a PHP issue, this statement works
> perfectly fine:
> SELECT * FROM `form` WHERE Email='$Email'
>[/ref]
Ah, I just realized something. "Show" is a reserved word. You
shouldn't be using it as a column name. But since you did, you need to
surround it with back tickies - i.e. `Show`.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
net
==================
Jerim79 schrieb:
What's the value in $Show?
Regards,
Jo
>SELECT * FROM `form` WHERE Email='$Email' AND Show='$Show'
I smell a keyword: show. As in "show tables".
SELECT * FROM `form` WHERE Email='$Email' AND `show`='$Show'
You need to show the statement as it is passed to MySQL. The above
search looks for an email address containing no and beginning with a
dollar sign.
"Jerim79" <com> wrote in message
news:googlegroups.com...
Isn't NAME a reserved word?
Perhaps:
SELECT * FROM form WHERE Email="com" AND [Name]="Name"
Bookmarks