Hi People
Im stuck on retrieving information from a database, the plan is that a user can load and view the contents of a db, following clicking on a drop down and selecting the article title, upon clicking on load the records stored in the database for that certain user are displayed.
here is my current code -
<?php
// Include the header:
$page_title = 'Retrieve Articles';
include ('includes/header.php')
?>
<strong><h1>Welcome to BrookXML</h1></strong>
<br />
<form action="retrieve.php" method="get">
<fieldset style="width:250px"><legend><strong>Title of Article: </strong></legend>
<select name="name" id="name">
</select><input type="submit" value="Load" name="load" /></fieldset>
</form>
<?php
try {
/*** The SQL SELECT statement ***/
$sql = "SELECT title FROM articles";
foreach ($dbc->query($sql) as $row)
{
print $row['title'].'<br />';
}
}
catch(PDOException $e)
{
echo $e->getMessage();
}
?>