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
$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
--- 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
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
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
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
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
, 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
[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
; [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
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
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
[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
. 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
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
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
$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
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
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 =
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
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
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
22 matches
Mail list logo