Using bindColumn variable in my map

wpoulos51

New Member
i've used bindColumn to put my database data which is latitude and longitude on variables. Now what i need is to use that in my google map. Can you guys tell me how can i access those variables.Here's my codes:**\[code\]<?php$dsn = 'mysql:host=localhost;dbname=db_account';$username = 'root';$password = '';$options = array( PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',); $dbh = new PDO($dsn, $username, $password, $options);function readData($dbh) { $sql = 'SELECT latitude, longitude FROM users WHERE pid = 2'; try { $stmt = $dbh->prepare($sql); $stmt->execute(); /* Bind by column number */ $stmt->bindColumn(1, $latitude); $stmt->bindColumn(2, $longitude); while ($row = $stmt->fetch(PDO::FETCH_BOUND)) { $data = http://stackoverflow.com/questions/15526508/$latitude ."\t" . $longitude . "\t" ."\n"; print $data; } } catch (PDOException $e) { print $e->getMessage(); }}readData($dbh);?>\[/code\]**Thank you guys in advance.
 
Back
Top