poleman Posted February 8, 2007 Share Posted February 8, 2007 What is Error: Duplicate entry '0' for key 1 and how can i fix it? The php code is as follows: <?php $con = mysql_connect ("db778.oneandone.co.uk","dbo191523062","zfMcsqnB"); if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("db191523062", $con);$sql="INSERT INTO phpbb_users(username, user_email) VALUES ('$_POST[name]','$_POST[useremail]')";if (!mysql_query ($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added";mysql_close($con) ?> with the form html code as follows: <form method="POST" action="newslettertest4.php"> Name: <input type="text" name="name" size="20"><br> Email: <input type="text" name="useremail" size="20"><br> <br> <button name="B1">Subscribe</button></p> </form> Please hope you can help. Thanks Link to comment https://forums.phpfreaks.com/topic/37652-going-nuts-here/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.