Advertisement

01.16.2008 at 09:33AM PST, ID: 23087729
[x]
Attachment Details

Error in your SQL syntax: HELP!

Asked by hankknight in PHP and Databases

This gives me an error:

  "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 '@example.com, 1200504533,555' at line 1

Here is my PHP

$result = mysql_query("Insert into users_users(user_name, user_pass, user_email, timestamp, user_ip) values(" . mysql_real_escape_string($username) . ", " . mysql_real_escape_string($userpass) . ", " . mysql_real_escape_string($useremail) . ", " . time() .", " . mysql_real_escape_string('111.111.111.111'), $con) or die('Could not query:' . mysql_error());;

I have attached the table structure.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
CREATE TABLE `users_users` (
  `userid` int(35) NOT NULL auto_increment,
  `user_name` varchar(50) NOT NULL default '',
  `user_pass` varchar(255) NOT NULL default '',
  `user_level` varchar(50) NOT NULL default '',
  `timestamp` int(10) default NULL,
  `user_email` varchar(50) NOT NULL default '',
  `user_ip` varchar(50) NOT NULL default '',
  PRIMARY KEY  (`userid`)
) TYPE=MyISAM AUTO_INCREMENT=132 CHARACTER SET utf8 COLLATE utf8_unicode_ci;
[+][-]01.16.2008 at 09:43AM PST, ID: 20674104

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]01.16.2008 at 09:44AM PST, ID: 20674113

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP and Databases
Sign Up Now!
Solution Provided By: syedasimmeesaq
Participating Experts: 2
Solution Grade: A
 
 
[+][-]01.16.2008 at 09:45AM PST, ID: 20674124

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906