I'm making a simple register php with the following code:
Code: Select all
<?php
include ('config.php');
$user=$_POST['user1'];
$pass=$_POST['pass1'];
$firstn=$_POST['firstn1'];
$lastn=$_POST['lastn1'];
$email=$_POST['email1'];
$query = "INSERT INTO accounts (ID,user,pass,firstn,lastn,email) VALUES (NULL,$user,$pass,$firstn,$lastn,$email)";
mysql_connect($localhost,$username,$password) or die("Unable to Connect");
@mysql_select_db($database) or die( "Unable to select database");
mysql_query($query) or die(mysql_error());
mysql_close();
echo "Went fine.";
?>Code: Select all
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 ',,,)' at line 1Mysql version: 5.0.22 Community
And using the latest PHP version.
I'd greatly appreciate any help.