gandalf458
IS-IT--Management
I'm using SQLite and I have the following to get a single record:
I'm not sure this is right but I'm not sure what I should have. Can anyone please help?
I'm not a number, I'm a free man
Code:
$query = 'SELECT * FROM talks WHERE id=:id;';
$stmt = $db->prepare($query);
$stmt->bindValue(':id', $id);
$stmt->execute();
$result = $stmt->fetchAll();
foreach ( $result as $row ) {
$address = $row['address'];
$num_views = $row['num_views'];
}
I'm not a number, I'm a free man