connection.php:
$con = mysql_connect("localhost","networka_root","secret");
if (!$con) die('Could not connect: ' . mysql_error());
mysql_select_db("networka_simple_login", $con);
$sql="INSERT INTO `networka` (`username`, `password`,)
VALUES ('$_POST[username]','$_POST[password]')";
if (!mysql_query($sql, $con)) die('Error: ' . mysql_error());
echo "1 record added";
mysql_close($con)
The error I get when I put in my username
and password
:
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
) VALUES ('username','password')
at line 1