Hi i am trying to get some test sheets done for some work collegues so i have added 160 Postcodes into a database and i am using this
to summon the database info
and its listing like this
but i want it to list like this
and its listing randomly each time
here the template code i use for the base
and here the postcodes bit template
how would i go around making it list like the above example ??
thanx in advance
PHP Code:
$postcodes = $DB_site->query("
SELECT
id, postcode
FROM " . TABLE_PREFIX . "postcodes
ORDER BY RAND()
");
while ($post = $DB_site->fetch_array($postcodes))
{
eval('$codes .= "' . fetch_template('_post_code_bits') . '";');
}
$DB_site->free_result($posts);
eval('print_output("' . fetch_template('_POST_CODE') . '");');
}
else
{
eval('print_output("' . fetch_template('_POST_CODE_ADD') . '");');
}
and its listing like this
Post Code: Line:
me ____________
tr ____________
me ____________
tr ____________
Post Code: Line: Post Code: Line:
me _________ tr _________
me _________ tr _________
here the template code i use for the base
Code:
<html> <head> <title>Display Post Codes</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <table width="30%" border="0" cellspacing="0" cellpadding="4"> $codes </table> <body> </body> </html>
Code:
<tr> <td width="5%" nowrap>$post[postcode]</td> <td width="100%">_______________</td> </tr>
thanx in advance
Comment