View Single Post
Old 02-17-2008, 06:15 AM   #3 (permalink)
sarmenhb
The Addict
 
sarmenhb's Avatar
 
Join Date: Jan 2008
Location: los angeles
Posts: 309
Thanks: 44
sarmenhb is on a distinguished road
Default

Quote:
Originally Posted by Andrew View Post
After the while block, add in:
PHP Code:
echo $block
And also add in a period before the first equal sign within the while block.
i put the echo and still doesnt work.

here is my function now

Code:
function dyn_dropdown($tablename,$columnname) {


	$query = mysql_query("SELECT $columnname FROM $tablename");
	
	if(mysql_num_rows($query))
	{
	
	while($row = mysql_fetch_assoc($query))
	{
		$options = $row['columnname'];
		echo "<option>$options</option>";

	}

	}
	else {
	echo "<option>no data</option>";
	}
__________________
no signature set
sarmenhb is offline  
Reply With Quote