how would i modify my code to check if there is already an existing record of the same coloumn name (field = option_name1) in the table?
I do have the option_name1 field already set as a unique and primary, but i would like to give user feeback via my code.
Thanks, much appreciated
-newbie
<?php include("dbconnect.php"); ?>
<?php
$query = "insert into table name"
." (option_name1, option_name2, option_name3) values "
."('$option_name', '$$option_name2', '$option_name3')"
;
$result = mysql_query($query);
if($result) {
echo "submission succesful"; }
else {
echo "error";
}
?>