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 r

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='$thin

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

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

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

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:

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

2004-02-26 Thread Axel IS Main
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

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 Hutchins, Richard
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&

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; > > $

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

2004-02-26 Thread Axel IS Main
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

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

2004-02-26 Thread Micah Stevens
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.

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

2004-02-26 Thread jeffrey_n_Dyke
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

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

2004-02-26 Thread Micah Stevens
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.

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

2004-02-26 Thread Axel IS Main
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

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

2004-02-26 Thread Micah Stevens
; >>> > >>>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. > >>

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

2004-02-26 Thread jeffrey_n_Dyke
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());

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

2004-02-26 Thread Muhammed Mamedov
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

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

2004-02-26 Thread Viorel Dragomir
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

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

2004-02-26 Thread Paul Fitz
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

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

2004-02-26 Thread Ricardo Lopes
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