Advertisement
Guest User

Untitled

a guest
Jul 10th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. $product_name = mysql_real_escape_string($_POST['product_name']);
  2. $product_name = sanitize($product_name);
  3.  
  4. $query = mysql_query("SELECT * FROM products WHERE product_name = '$product_name' LIMIT 1");
  5. $match = mysql_num_rows($query); // count the output amount
  6. if (($match > 0)===true) {
  7. $errors[]='Sorry you tried to place a duplicate "Product Name" into the system!';
  8. break 1;
  9. }
  10.  
  11. if ($match > 0) {
  12.  
  13. if (($match > 0)===true) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement