OK, Hello to all of you,
I am a little stuck so need a little help..
this is the code in the controller:
this is the file autumntern.php;PHP Code:<?php
if (isset($_GET['addinvoice']))
{
include 'form.html.php';
exit();
}
include '../includes/db.inc.php';
if (isset($_POST['term_1']))
{
global $link;
$result = mysqli_query($link, 'SELECT * FROM jos_reg');
if (!$result)
{
$error = 'Error fetching children: ' . mysqli_error($link);
include 'error.html.php';
exit();
}
while ($row = mysqli_fetch_array($result))
{
$id[] = $row['id'];
$familyid[] = $row['familyid'];
}
include 'autumnterm.php';
}
?>
Code HTML4Strict:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>List of Children</title> </head> <body> <p>This is for the Autum Term:</p> <?php foreach ($id as $id);?> <blockquote><p> <?php echo htmlspecialchars($id, ENT_QUOTES, 'UTF-8');?> </p></blockquote> </body> </html>
now I feel that it should be showing all of the id's in the DB, but it is only showing the last one, can someone please tell me what I am doing wrong and tell me what I need to put into the code for it to bring all the id's and also would like to add a few more columns to the foreach, how would I do that, so I would like familid, id and a few more to show in the html include.
Thanks









Bookmarks