Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function dbUpdatePlaceWithAssoc($a){
- // inserts pic locations to pic table
- // a = filename
- $DB_NAME = "jt";
- $DB_HOST = "127.11.235.129";
- $DB_USER = "jt_write";
- $DB_PASS = "y7f8dsya8y7yy78o";
- //$DB_NAME = "jt";
- //$DB_HOST = "localhost";
- //$DB_USER = "jt";
- //$DB_PASS = "hf94h89h8493h89h94";
- $mysqli = new mysqli($DB_HOST,$DB_USER,$DB_PASS,$DB_NAME);
- if(mysqli_connect_errno()){
- echo "Couldn't connect to db: ".mysqli_connect_error()."\n";
- exit();
- }
- // connected
- if($stmt = mysqli_prepare($mysqli, "UPDATE place SET name=?, address=?, city=?, state=?, zip=?, lat=?, lng=?, description=?, phone=?, email=?, website=? WHERE placeID=?")){
- echo "binding parms\n";
- 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']);
- mysqli_stmt_execute($stmt);
- mysqli_stmt_close($stmt);
- }else{
- echo "IS THIS EVEN GETTING CALLED?";
- echo "\"".$mysqli_error($mysqli)."\"<br />Couldn't update the place. Quitting.";
- exit();
- }
- echo "Updated place\n";
- // everything was inserted, get ID
- }
Add Comment
Please, Sign In to add comment