Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newby Needs Help W/ Insert Into Statement

Status
Not open for further replies.

ballbearing

Technical User
Joined
Jan 7, 2004
Messages
43
Location
US
I'm starting to get the hang of things, but SQL stuff is a bit frustrating. Anyway, I've been trying to get this to work but no luck. I've removed quotes, dots, $ signs and just about everything else. The statement is:

INSERT INTO users VALUES (2, '.$_SERVER['REMOTE_ADDR'].', 'admin', 'admin', '123 My Street', 'Belmont', 'North Carolina', '28012', 'United States of America', '.$siteemail.', '7048251111', NULL, '', '.$username.', '.md5($password).', 1, NOW(), '', '', '', NULL, NOW(), '', '', '');;

Error reports:

INSERT INTO users
VALUES ( 2, '.$_SERVER['REMOTE_ADDR '].', 'admin', 'admin', '123 My Street', 'Belmont', 'North Carolina', '28012', 'United States of America', '.$siteemail.', '7048251111', NULL , '', '.$username.', '.md5($password).', 1, NOW( ) , '', '', '', NULL , NOW( ) , '', '', '' )

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'REMOTE_ADDR'].', 'admin', 'admin', '123 My Street', 'Belmont', 'North Carolina',' at line 1


Can someone please get this thing into a statement that SQL actually will accept? Thanks loads to anyone.
 
this is a php quoting error

would you mind please re-posting this problem in the php forum

r937.com | rudy.ca
 
Sorry. I'm in uncharted territory here. Thanks anyway.
 
PHP forum is here:
forum434

you can post there, and make sure to post the complete query string, variable and all quotes involved.

You seem to have quoting issues

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top