How to avoid duplication entry via form into database

Posted by DAFFODIL on Stack Overflow See other posts from Stack Overflow or by DAFFODIL
Published on 2010-03-30T19:02:57Z Indexed on 2010/03/30 19:23 UTC
Read the original article Hit count: 367

Filed under:
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
  die('Could not connect: ' . mysql_error());
}

mysql_select_db("form", $con);

$reb = "select count(*) from customer where name = '$name';"
if (mysql_result($reb,0) > 0) {
  echo "Item Already Added!<br>";
} else {
  // add the item
}
mysql_close($con);
header( 'Location: http://localhost/cus.php' );
?>

Parse error: parse error in C:\wamp\www\c.php on line 10

© Stack Overflow or respective owner

Related posts about php