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 r
--- 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='$thin
$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
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
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
; [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:
Actually, yes, a thousand times is an obvious exaggeration, but I have
done a whole lot of times, and the query syntax is the query syntax.
Different don't make it wrong. This is working in several other places
throughout this particular set of scripts.
Paul Fitz wrote:
You haven't done that a
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
thing 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&
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;
>
> $
lts 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 with this query?
Ok, ok. I get the message a
t; >And check out what gets spit out to the browser when $sql is echoed? Maybe
> >that'll point out something that's going wrong. If nothing is apparent,
> > post the results of echo $sql back to the list and maybe one of us will
> > find something.
> >
> >HTH.
7;s going wrong. 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, Febr
eck out what gets spit out to the browser when $sql is echoed? Maybe
> >that'll point out something that's going wrong. If nothing is apparent,
>
> post
>
> >the results of echo $sql back to the list and maybe one of us will find
> >something.
> >
> >HTH.
ing that's going wrong. 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: PH
; >>>
> >>>Most times, when I run into query problems, immediately before I send
> >>> the query to the database, I'll echo the statement out to the browser
> >>> so I can see the exact string that's being sent to the db.
> >>
gt;>>$sql = "INSERT INTO log SET term='$search', returns='$arrayword',
>>>time=CURTIME(), date=CURDATE(), ip='$ip'";
>>>
>>>echo $sql;
>>>
>>>$logit = mysql_query($sql) or
>>> die(mysql_error());
Try this:
$logit = mysql_query("INSERT INTO log (term,returns,time,date,ip) VALUES
('$search','$arrayword',CURTIME(), CURDATE(), '$ip'"));
Regards,
Muhammed Mamedov
turkmenweb.com
- Original Message -
From: "Axel IS Main" <[EMAIL PROTECTED]>
To: "PHP-DB" <[EMAIL PROTECTED]>
Sent: Thursd
t; <[EMAIL PROTECTED]>
Sent: Thursday, February 26, 2004 11:18 AM
Subject: Re: [PHP-DB] What's wrong with this query?
> What is the error? there i something i always do when i have this problem,
> try this:
>
> error_reporting(E_ALL);
> $sql = "INSERT INTO log SET t
You haven't done that a thousand times - the syntax is wrong :).
You are using a combo of INSERT and UPDATE syntax there.
Try
INSERT INTO log (term, returns, time, date, ip) VALUES ('$search',
'$arrayword',CURTIME(), CURDATE(), '$ip');
Cheers,
Paul
-Original Message-
From: Axel IS
What is the error? there i something i always do when i have this problem,
try this:
error_reporting(E_ALL);
$sql = "INSERT INTO log SET term='$search', returns='$arrayword',
time=CURTIME(), date=CURDATE(), ip='$ip'");
echo $sql;
$logit = mysql_query($sql);
This makes all kind of notice about un
21 matches
Mail list logo