Results 1 to 12 of 12
Oct 30, 2012, 14:36 #1
- Join Date
- Oct 2012
- 1 Post(s)
- 0 Thread(s)
Help me with this PHP and MYSQL code
am having little problem with SELECT statement in my PHP and MYSQL tutorial....when I connect to my database and I want to use PHP try-catch to SELECT the database content with the code below butI always get a PDOException error message that say "no database selected"
$sql = 'SELECT booktext FROM book';
$result = $pdo->query($sql);
catch (PDOException $e)
$error = "error fetching books: " . $e->getMessage();
while ($row = $result->fetch());
$jokes = $row['booktext'];
help me out....