I've been learning php/mySQL thru a manual by sitepoint and have run into a problem trying to complete a challenge in the book.
They've asked me to create a delete confirmation screen for a db of jokes. I'd like to list the the name of the author to be deleted and all of his/her jokes. I believe the bindValue command is causing me issues...
Any insight as to what my be wrong in this code would be great help. Cheers!
- Code: Select all
include $_SERVER['DOCUMENT_ROOT'] . '/phpbed/includes/dbconnect.php';
echo 'id ' . $_POST['id'] . '<br>';
$sql = 'SELECT joketext FROM joke WHERE authorid = :id';
$result = $pdo->query($sql);
while ($row = $result->fetch())
$joke = $row['joketext'];
including all of this authors jokes?
<?php foreach ($joke as $bleh): ?>
<p><?php echo $bleh; ?> </p>
<?php endforeach; ?>
Please note that i've plopped a bunch of test echoes and i can't seem to get past test4.