Code: Select all
<form action="mail.php" method="POST">
Email: <input type="text" name="email" size="60"><br>
<input type="submit" value="Add Email">
</form>Now this is what i'm using to insert the code to the database on mail.php:
Code: Select all
<?php
$conn = mysql_connect("localhost", "USERNAME", "PASSWORD");
mysql_select_db("DATABASE", $conn) or die(mysql_error());
$sql1 = "INSERT INTO mailing VALUES('',$_POST[email])";
$result1 = mysql_query($sql1, $conn) or die(mysql_error());
?>Any reason why??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 '@gmail.com)' at line 1