I'm new to PDO and PHP, I'm wondering how I would go about defining vars from the information being pulled from my table.
I have the following:
$UID = $_GET['id'];
$sth = $conn->prepare("SELECT * FROM directory WHERE user_active != '' AND ID = '$UID'");
$sth->execute();
while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
echo $row['First_Name'] . ' ' . $row['Surname'] . "
";
echo '<img src="http://maps.google.com/maps/api/staticmap?center=' . $row["Location_Postcode_Last_Seen"] . '&zoom=1
4&size=200x200&maptype=roadmap&markers=color:ORANGE|label:A|' . $row["Location_Postcode_Last_Seen"] . '&sensor=true">';
echo $row["Nicknames"];
echo $row["Age"];
}
If I try adding:
var $name = echo $row['First_Name'] . ' ' . $row['Surname'];
within my while
loop the code fails to output anything to my browser.