Guest User

Untitled

a guest
Nov 25th, 2018
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.18 KB | None | 0 0
  1. function dbUpdatePlaceWithAssoc($a){
  2.   // inserts pic locations to pic table
  3.   //   a = filename
  4.   $DB_NAME = "jt";
  5.   $DB_HOST = "127.11.235.129";
  6.   $DB_USER = "jt_write";
  7.   $DB_PASS = "tvmEcQu4DGMzy2tS";
  8.   //$DB_NAME = "jt";
  9.   //$DB_HOST = "localhost";
  10.   //$DB_USER = "jt";
  11.   //$DB_PASS = "5jhbJLpY23QC57nt";
  12.   $mysqli = new mysqli($DB_HOST,$DB_USER,$DB_PASS,$DB_NAME);
  13.   if(mysqli_connect_errno()){
  14.     echo "Couldn't connect to db: ".mysqli_connect_error()."\n";
  15.     exit();
  16.   }
  17.   // connected
  18.   if($stmt = mysqli_prepare($mysqli, "UPDATE place SET name=?, address=?, city=?, state=?, zip=?, lat=?, lng=?, description=?, phone=?, email=?, website=? WHERE placeID=?")){
  19.     echo "binding parms\n";
  20.     mysqli_stmt_bind_param($stmt, "sssssddssssi", $a['name'], $a['address'], $a['city'], $a['state'], $a['zip'], $a['lat'], $a['lng'], $a['description'], $a['phone'], $a['email'], $a['website'], $a['p']);
  21.     mysqli_stmt_execute($stmt);
  22.     mysqli_stmt_close($stmt);
  23.   }else{
  24.     echo "IS THIS EVEN GETTING CALLED?";
  25.     echo "\"".$mysqli_error($mysqli)."\"<br />Couldn't update the place.  Quitting.";
  26.     exit();
  27.   }
  28.   echo "Updated place\n";
  29.   // everything was inserted, get ID
  30. }
Add Comment
Please, Sign In to add comment