Guest User

Untitled

a guest
Nov 17th, 2015
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.86 KB | None | 0 0
  1. <?php    
  2.    
  3.    $mysqli = new mysqli('localhost', 'user', 'haslo', 'nazwabazy');    
  4.    
  5.    if ($mysqli->connect_errno) {    
  6.    
  7.  $mysqli->connect_errno . ") " . $mysqli->connect_error;    
  8.    
  9.       exit();      
  10.    }    
  11.    
  12.    if (!($stmt = $mysqli->prepare("INSERT INTO Track (Latitude, Longitude, ID) VALUES (?,?,?)"))) {    
  13.    
  14.  $mysqli->errno . ") " . $mysqli->error;        
  15.    }        
  16.  
  17.    $Latitude   = $_GET['lt'];      
  18.    $Longitude  = $_GET['ln'];    
  19.    $ID    = $_GET['d'];    
  20.    
  21.    if (!$stmt->bind_param("ddss", $Latitude, $Longitude, $ID)) {    
  22.  $stmt->errno . ") " . $stmt->error;        
  23.    }        
  24.          
  25.    if (!$stmt->execute()) {    
  26.  $stmt->errno . ") " . $stmt->error;    
  27.    }        
  28.          
  29.    //-- Closing connection / cleanup    
  30.    $stmt->close();        
  31.    mysqli_close($mysqli);        
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment