I was hoping to get a little idea about this.
I have a form collecting first name, last name, city, state and email address. This form uses the jquery validation plugin and form plugin.
I would like to check if email exists ... if that is the case, then spit out a message that tells them that they already exist.
This is what I have for my update.php script, in which the form used to add names to the mysql database:
<?php $con = mysql_connect("host","username","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("table", $con); $sql="INSERT INTO wallnames (ID, firstname, lastname, city, state, email) VALUES('NULL','$_POST[firstname]','$_POST[lastname]','$_POST[city]','$_POST[state]','$_POST[email]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "<p style=\width:350px; height:200px; vertical-align:middle;\><strong>Thank you for adding your info</strong></p>"; mysql_close($con); ?>
source share