[PHP-DB] What's wrong with this QUERY??

2004-07-22 Thread Harry G
Hi, I have a database with members details and PK is id. $thing = [EMAIL PROTECTED]; $query = SELECT id, email, familyname FROM members WHERE email=$thing; $result = mysql_query($query); If i do a query where id=$thing. and $thing=20; this works fine and I get the desired result. But what is

Re: [PHP-DB] What's wrong with this QUERY??

2004-07-22 Thread Larry E . Ullman
$thing = [EMAIL PROTECTED]; $query = SELECT id, email, familyname FROM members WHERE email=$thing; You need to quote non-numeric values in SQL. It should be $query = SELECT id, email, familyname FROM members WHERE email=''$thing'; Also, you don't really need to select the email value since you

Re: [PHP-DB] What's wrong with this QUERY??

2004-07-22 Thread zareef ahmed
--- Harry G [EMAIL PROTECTED] wrote: Hi, I have a database with members details and PK is id. $thing = [EMAIL PROTECTED]; $query = SELECT id, email, familyname FROM members WHERE email=$thing; Make it $query = SELECT id, email, familyname FROM members WHERE email='$thing'; It should

Re: [PHP-DB] What's wrong with this QUERY??

2004-07-22 Thread Jason Wong
On Friday 23 July 2004 10:57, Harry G wrote: I have a database with members details and PK is id. $thing = [EMAIL PROTECTED]; $query = SELECT id, email, familyname FROM members WHERE email=$thing; $query = SELECT id, email, familyname FROM members WHERE email='$thing'; Please refer to

[PHP-DB] What's wrong with this query?

2004-02-26 Thread Axel IS Main
I've just tried to do something I've done a thousand times. It does not work. I've checked all of the syntax, made sure the field and variable names are correct. No matter what I do it just doesn't work. The table remains empty. Here's the query: $logit = mysql_query(INSERT INTO log SET

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Ricardo Lopes
script. If you can't see the problem after this post the output of this code. - Original Message - From: Axel IS Main [EMAIL PROTECTED] To: PHP-DB [EMAIL PROTECTED] Sent: Thursday, February 26, 2004 9:05 AM Subject: [PHP-DB] What's wrong with this query? I've just tried to do something

RE: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Paul Fitz
IS Main [mailto:[EMAIL PROTECTED] Sent: Thursday, February 26, 2004 7:06 PM To: PHP-DB Subject: [PHP-DB] What's wrong with this query? I've just tried to do something I've done a thousand times. It does not work. I've checked all of the syntax, made sure the field and variable names are correct

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Muhammed Mamedov
, February 26, 2004 11:05 AM Subject: [PHP-DB] What's wrong with this query? I've just tried to do something I've done a thousand times. It does not work. I've checked all of the syntax, made sure the field and variable names are correct. No matter what I do it just doesn't work. The table remains

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Axel IS Main
[mailto:[EMAIL PROTECTED] Sent: Thursday, February 26, 2004 2:37 PM To: PHP DB Subject: Re: [PHP-DB] What's wrong with this query? Ok, ok. I get the message about the syntax. Since I've used this syntax for a long time and so far there hasn't been a problem I'll assume that's not the problem. I

RE: [PHP-DB] What's wrong with this query?

2004-02-26 Thread brett king
; [EMAIL PROTECTED]; PHP DB Subject: Re: [PHP-DB] What's wrong with this query? exactly, i'm using it for more than a year - Original Message - From: Erwin Kerk [EMAIL PROTECTED] To: [EMAIL PROTECTED]; PHP DB [EMAIL PROTECTED] Sent: Thursday, February 26, 2004 5:36 PM Subject: Re: [PHP-DB

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Axel IS Main
PROTECTED] Sent: Thursday, February 26, 2004 7:06 PM To: PHP-DB Subject: [PHP-DB] What's wrong with this query? I've just tried to do something I've done a thousand times. It does not work. I've checked all of the syntax, made sure the field and variable names are correct. No matter what I do it just

RE: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Hutchins, Richard
to the list and maybe one of us will find something. HTH. Rich -Original Message- From: Axel IS Main [mailto:[EMAIL PROTECTED] Sent: Thursday, February 26, 2004 2:37 PM To: PHP DB Subject: Re: [PHP-DB] What's wrong with this query? Ok, ok. I get the message about the syntax. Since I've

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Axel IS Main
[mailto:[EMAIL PROTECTED] Sent: Thursday, February 26, 2004 2:37 PM To: PHP DB Subject: Re: [PHP-DB] What's wrong with this query? Ok, ok. I get the message about the syntax. Since I've used this syntax for a long time and so far there hasn't been a problem I'll assume that's not the problem. I

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Micah Stevens
. If nothing is apparent, post the results of echo $sql back to the list and maybe one of us will find something. HTH. Rich -Original Message- From: Axel IS Main [mailto:[EMAIL PROTECTED] Sent: Thursday, February 26, 2004 2:37 PM To: PHP DB Subject: Re: [PHP-DB] What's wrong

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread jeffrey_n_Dyke
To: PHP DB Subject: Re: [PHP-DB] What's wrong with this query? Ok, ok. I get the message about the syntax. Since I've used this syntax for a long time and so far there hasn't been a problem I'll assume that's not the problem. I will, however, review this and probably make some changes

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Micah Stevens
will find something. HTH. Rich -Original Message- From: Axel IS Main [mailto:[EMAIL PROTECTED] Sent: Thursday, February 26, 2004 2:37 PM To: PHP DB Subject: Re: [PHP-DB] What's wrong with this query? Ok, ok. I get the message about the syntax. Since I've used this syntax

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Micah Stevens
$sql back to the list and maybe one of us will find something. HTH. Rich -Original Message- From: Axel IS Main [mailto:[EMAIL PROTECTED] Sent: Thursday, February 26, 2004 2:37 PM To: PHP DB Subject: Re: [PHP-DB] What's wrong with this query? Ok, ok. I get the message about

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread jeffrey_n_Dyke
Message- From: Axel IS Main [mailto:[EMAIL PROTECTED] Sent: Thursday, February 26, 2004 2:37 PM To: PHP DB Subject: Re: [PHP-DB] What's wrong with this query? Ok, ok. I get the message about the syntax. Since I've used this syntax for a long time and so far there hasn't been a problem I'll

RE: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Daniel Clark
What about the single quotes? Might try this. $sql = INSERT INTO log SET term=\'$search\', returns=\'$arrayword\', time=CURTIME(), date=CURDATE(), ip=\'$ip\'; $sql = INSERT INTO log SET term='$search', returns='$arrayword', time=CURTIME(), date=CURDATE(), ip='$ip'; echo $sql; $logit =

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Axel IS Main
Ok, ok. I get the message about the syntax. Since I've used this syntax for a long time and so far there hasn't been a problem I'll assume that's not the problem. I will, however, review this and probably make some changes for the sake of compliance if nothing else. In any event, the syntax is

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Nitin Mehta
exactly, i'm using it for more than a year - Original Message - From: Erwin Kerk [EMAIL PROTECTED] To: [EMAIL PROTECTED]; PHP DB [EMAIL PROTECTED] Sent: Thursday, February 26, 2004 5:36 PM Subject: Re: [PHP-DB] What's wrong with this query? Viorel Dragomir wrote: I'm using MySQL

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Erwin Kerk
Viorel Dragomir wrote: I'm using MySQL for about 2 years and never heard about this kind of INSERT. Is not SQL compliant neither. YOU CAN NOT MAKE : INSERT INTO table SET var=1 [as I know] As a matter of fact it IS possible, according to the MySQL manual on http://www.mysql.com/doc/en/INSERT.html