Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. $result = mysql_query("SELECT * FROM coupon WHERE Email_Address='$address'");
  2.  
  3.     if (mysql_num_rows($result)==0){
  4.         echo "ADDING TO DATABASE: " . $address;
  5.         if( FALSE === mysql_query("INSERT INTO coupon (Date_Issued, Email_Address, Coupon_Code, Coupon_Expiry) VALUES ('".date(Y-m-d)."', '$address', '$couponcode', LAST_DAY('".date(Y-m-d)."'))") ) echo mysql_error();
  6.  
  7.     }
  8.  
  9.  
  10. /// ERROR: Column 'Coupon_Expiry' cannot be null
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement