I want to add select menus to the registration form within the form_functions script, using data retrieved from the database instead of hard coding them. I tried the code included below after l looked at the form_function script for the coffee site, but get the following errors:
Warning: print_r() [function.print-r]: Couldn't fetch mysqli_result in C:\xampp\htdocs\site\includes\config.inc.php on line 69
Warning: print_r() [function.print-r]: Property access is not allowed yet in C:\xampp\htdocs\site\includes\config.inc.php on line 69
The "require Config and MySQL" are contained in the header.
} elseif ($type == 'select') { // Create a select menu.
if (($name == 'timezone')) { // Create a list of timezones.
// Retrieve the timezones.
$q = "SELECT timezone_id, timezone FROM timezones ORDER BY timezone ASC";
$r = mysqli_query ($dbc, $q);
while ($row = mysqli_fetch_array ($r, MYSQLI_NUM)) {
echo "<option value=\"$row[0]\"";
}
$data = $r;
// Free the results:
mysqli_free_result($r);
Thank you in advance.