Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include '../functions.php';
- session_start();
- if(isset($_POST['id'])){
- $db = connectToDb('myDb');
- $db->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
- $db->setAttribute(\PDO::ATTR_EMULATE_PREPARES, false);
- $id = $_POST['id'];
- $getGeo = $db->prepare("SELECT Y(geo_position) AS y FROM geo WHERE geo_id = :id");
- $getGeo->execute(['id'=>$id]);
- if (!$getGeo->rowCount()) {
- // no results for given $id, handle error
- echo "ERROR ROWCOUNT";
- }
- $y = $getGeo->fetchColumn(0);
- $getGeo->closeCursor();
- echo json_encode($y);
- }else{
- echo "ERREUR ID NOT SET";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement