Click here to Skip to main content
15,885,366 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
GeneralRe: python just for fun Pin
shahab9612-Jan-11 4:42
shahab9612-Jan-11 4:42 
GeneralRe: python just for fun Pin
HimanshuJoshi12-Jan-11 17:12
HimanshuJoshi12-Jan-11 17:12 
AnswerRe: python just for fun Pin
Sterling Camden / independent consultant11-Jan-11 4:48
Sterling Camden / independent consultant11-Jan-11 4:48 
GeneralRe: python just for fun Pin
shahab9612-Jan-11 4:44
shahab9612-Jan-11 4:44 
GeneralRe: python just for fun Pin
cjoki12-Jan-11 4:47
cjoki12-Jan-11 4:47 
GeneralRe: python just for fun Pin
shahab9612-Jan-11 17:01
shahab9612-Jan-11 17:01 
AnswerRe: python just for fun Pin
HimanshuJoshi12-Jan-11 17:15
HimanshuJoshi12-Jan-11 17:15 
Questiondynamic dropdown list Pin
komanche9-Jan-11 23:53
komanche9-Jan-11 23:53 
Hi am back again after weeks of trying to populate multiple combo box from a mysql database.
I have a script that loads one combo box / drop down list well by populating car make.
The lists are supposed to be first "car make" then second "car model" third "car badge" fourth is "car description"
the code at present is
PHP
<?php
	
	
	include("../includes/store.php");
	
	//echo mysql command
	$query = "SELECT make FROM cars";
		$result  = mysql_query($query) or die(mysql_error()); //excute or return if there is an error
		
		echo "Make";
		$dropdown = "<select name='make'>";
			while ($row = mysql_fetch_assoc($result))
			{
				$dropdown .=  "\r\n<option value='{$row['make']}'>{$row['make']}</option>";
			}
			$dropdown .= "\r\n</select>";
			echo $dropdown;
			echo "<br>" . "<br>";
			
	$query1 = "SELECT model FROM carmodel WHERE makeid = {$row['id']}";
	$carmodel = mysql_query($query1) or die(mysql_error()); //execute query and load fields to page
	
		echo "Model";
		$list2 = "<select name='model'>";
			while ($row = mysql_fetch_assoc($carmodel))
			{
				$list2 .= "\r\n<option value='{$row['model']}'>{$row['model']}</option>";
			}
			$list2 .= "\r\n</select>";
			echo $list2;

?> 


The database table are
table 1 cars = "carid" & "make"
table 2 carmodel = "modelid" & "makeid" & "model"
table 3 badge = "badgeid" & "modelid" & "badge"
table 4 cardesc = "descid" & "badgeid" & "yearofman" & "transmission" & "drivetype" & "fueltype"

I can populate the first dropdown list but how to get the second drop down to populate with the car model records based on the selected car make
then the cars badge of the filtered car model the description is proving to be a pickle. Please help as after days of searching and playing with code
cant seem to nail it right.
Thanks in advance.
AnswerRe: dynamic dropdown list Pin
Gerben Jongerius10-Jan-11 0:29
Gerben Jongerius10-Jan-11 0:29 
QuestionApplication Scope Array Pin
vb develop5-Jan-11 2:48
vb develop5-Jan-11 2:48 
AnswerRe: Application Scope Array Pin
cjoki5-Jan-11 10:42
cjoki5-Jan-11 10:42 
GeneralRe: Application Scope Array [modified] Pin
vb develop6-Jan-11 2:44
vb develop6-Jan-11 2:44 
GeneralRe: Application Scope Array Pin
cjoki6-Jan-11 4:53
cjoki6-Jan-11 4:53 
Questionhttp post response id capture Pin
0b4m44-Jan-11 22:54
0b4m44-Jan-11 22:54 
AnswerRe: http post response id capture Pin
cjoki5-Jan-11 4:54
cjoki5-Jan-11 4:54 
AnswerRe: http post response id capture Pin
47_MasoN_476-Jan-11 9:59
professional47_MasoN_476-Jan-11 9:59 
GeneralRe: http post response id capture Pin
0b4m410-Jan-11 5:42
0b4m410-Jan-11 5:42 
QuestionSession destory error Pin
SRJ922-Jan-11 3:30
SRJ922-Jan-11 3:30 
AnswerRe: Session destory error Pin
Graham Breach2-Jan-11 23:14
Graham Breach2-Jan-11 23:14 
QuestionNot sure what it's called Pin
MacRaider428-Dec-10 2:47
MacRaider428-Dec-10 2:47 
AnswerRe: Not sure what it's called PinPopular
Smithers-Jones28-Dec-10 2:59
Smithers-Jones28-Dec-10 2:59 
GeneralRe: Not sure what it's called Pin
MacRaider428-Dec-10 3:06
MacRaider428-Dec-10 3:06 
GeneralRe: Not sure what it's called Pin
Smithers-Jones29-Dec-10 11:02
Smithers-Jones29-Dec-10 11:02 
QuestionBest PHP Webmail system to access mail remotely Pin
mario202726-Dec-10 19:14
mario202726-Dec-10 19:14 
AnswerRe: Best PHP Webmail system to access mail remotely Pin
Gerben Jongerius26-Dec-10 20:40
Gerben Jongerius26-Dec-10 20:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.