Re: Drop-down box in php

From: Date: Wed, 21 Apr 2004 18:20:41 +0000
Subject: Re: Drop-down box in php
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-34018@lists.php.net to get a copy of this message
From: andy amol > I am using the following code, but it is not populating my script. If you can help I would be grateful. > I am using mysql as database. > <? > $sql = "SELECT course_id FROM course"; > $sql_result = mysql_query($sql) > or die("Couldn't execute query."); > while ($row = mysql_fetch_array($sql_result)) { > $type = $row["course_id"]; > $typedesc =$row["dept_id"]; > $option_block .= "<OPTION value=\"$type\">$typedesc</OPTION>"; You're using ["dept_id"], but not selecting that column in your query. ---John Holmes...

« previous php.db (#34018) next »