Guest User

Untitled

a guest
Oct 11th, 2016
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.16 KB | None | 0 0
  1. <?php
  2.  
  3. $host='52.40.52.130:3306';
  4. $user='root';
  5. $password='sitem123!';
  6.  
  7. $connection = mysqli_connect($host,$user,$password, "AromaDB");
  8.  
  9. $CustName = $_POST["CName"];
  10. $CustSurname = $_POST['CSurn'];
  11. $CustCellphone = $_POST['CCell'];
  12. $CustEmail = $_POST["CEmail"];
  13. $CustPoint = 0;
  14. $CustCredit = 0;
  15.  
  16.  
  17.  
  18. if(!$connection){
  19.     die('Connection Failed');
  20. }
  21. else {
  22.     //$dbconnect = @mysqli_select_db($connection,'AromaDB');
  23.  
  24.    
  25.     //if(!$dbconnect){
  26.         //die('Could not connect to Database');
  27.     //}
  28.     //else{
  29.         $sql = "INSERT INTO Customer (CName, CSurname, CCellphone, CEmail, CPoint_Total, CCredit_Total) VALUES ('"
  30.             . $CustName . "', '" . $CustSurname . "', '" . $CustCellphone . "', '" . $CustEmail . "', " . $CustPoint . ", " . $CustCredit . ");";
  31.         $Cust = mysqli_query($connection, $sql) or die(mysql_error());
  32.        
  33.         //$Cust = mysql_query("CALL sp_Insert_Customer('$CustName','$CustSurname','$CustCellphone','$CustEmail',$CustPoint,$CustCredit);") or die(mysql_error());
  34.        
  35.        
  36.         echo 'Customer Successfully added.';
  37.         mysqli_close($connection);
  38.         //echo $Cust;
  39.     //}
  40. }
Add Comment
Please, Sign In to add comment