daily pastebin goal
41%
SHARE
TWEET

Untitled

a guest Jan 29th, 2018 52 in 21 hours
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $link = mysqli_connect("localhost", "my_user", "my_password", "world");
  3.  
  4. /// create cart
  5. $query = "INSERT INTO myCity VALUES (NULL, 'Stuttgart', 'DEU', 'Stuttgart', 617000)";
  6. /// run the query
  7. mysqli_query($link, $query);
  8. $cart_id =  mysqli_insert_id($link)
  9. if ($cart_id){// if success
  10.     printf ("New Record has id %d.\n", $cart_id);
  11. }else{
  12. // handle errors
  13. }
  14.  
  15. /// Modify this to create a user account
  16. if ($result = mysqli_query($link, "insert..... ..... .... " . $cart_id)) {
  17.     printf("Select returned %d rows.\n", mysqli_num_rows($result));
  18.  
  19.     /* free result set */
  20.     mysqli_free_result($result);
  21. }else{// if failed...
  22. //
  23. }
  24. ?>
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top