View Single Post
  #1 (permalink)  
Old 06-13-2007, 09:38 AM
Lee's Avatar
Lee Lee is offline
PT Staff*
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: Blackpool, UK
Posts: 616
iTrader: (0)
Lee is just really niceLee is just really niceLee is just really niceLee is just really nice
MySQL error when submitting php

I get the following error when i fill in my form:
Code:
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 'from) VALUES ('Username', 'pass', 'emailwillbehere', 'UK')' at line 1
Here is the code for this section:
PHP Code:
$usr $_POST['usr'];
$pwd $_POST['pwd'];
$email $_POST['email'];
$from $_POST['from'];

$conn mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db($db);

$query "INSERT INTO users (usr, pwd, email, from) VALUES ('$usr', '$pwd', '$email', '$from')";

mysql_query($query) or die(mysql_error()); 
(obviously im not showing the conection variables.)

I dont know what i am doing wrong, can anyone help me with what my error maybe?

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote