Build Categories based on an static Array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am trying to build a SELECT MENU (with categories). I cant seem to get the syntax correct. Little help:

	// Get Areas values for MENU
	$AreasList = "<select name=\"Area_id\"><option value=''></option>";
	
	$queryR = array(0 => 'Domestic','International','Special');
	while($rowR = $queryR->fetch_assoc()) {
	
	$AreasList .= "<optgroup label=\"{$rowR['Region_Name']}\">";
	$Area_Type = $rowR['Area_Type'];
	

$query2 = "SELECT Area_id,Area FROM Areas WHERE `Area_Type`='$Area_Type' ORDER BY Area";
	$results2 = $db->query($query2) or die("No Area found.");
	
		while($row2 = $results2->fetch_assoc()) {
$AreasList .= "<option value='{$row2['Area_id']}'>{$row2['Area']}</option>";
			}
		$AreasList .= "</optgroup>";	
	}

	$AreasList .= "</select>";



Don Wieland
D W   D a t a   C o n c e p t s
~~~~~~~~~~~~~~~~~~~~~~~~~
donw@xxxxxxxxxxxxxxxxxx
Direct Line - (949) 305-2771

Integrated data solutions to fit your business needs.

Need assistance in dialing in your FileMaker solution? Check out our Developer Support Plan at:
http://www.dwdataconcepts.com/DevSup.html

Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or higher
http://www.appointment10.com

For a quick overview -
http://www.appointment10.com/Appt10_Promo/Overview.html


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux