Obtaining a value from dynamic list box

From: Date: Thu, 22 Feb 2001 18:51:21 +0000
Subject: Obtaining a value from dynamic list box
Groups: php.general 
Request: Send a blank email to php-general+get-41190@lists.php.net to get a copy of this message
When selecting a value from a dynamically generated list box, the subsequent value passed to the table truncates when there is a blank in the string Here is the table structures (Mysql database) First table has variable course_name (varchar -- length 50) This database will be used to generate the dynamic list box for the course_name field. Second table has variable issue_course_name (varchar -- length50) and is the variable that stores the result of the selected course name in the dynamic list box. Here is the code that is currently truncating all characters after the space: td height="41" bgcolor="#FFFFFF">&nbsp;&nbsp;'; $result = mysql_query("select course_name from coursebuild where course_status = \"in_test\" order by course_name asc"); echo "<select name='issue_course_name' size=1>"; echo "<option value=''> ----Select Course---- \n"; if ($myrow = mysql_fetch_array($result)) { do { echo "<option value=$myrow[course_name]>$myrow[course_name]</option>\n"; } while ($myrow = mysql_fetch_array($result)); echo "</select>"; Insert statement $query = "insert into testissues ( issue_course_name) values ( '$issue_course_name') "; $mysql_result = mysql_query($query, $mysql_link);

« previous php.general (#41190) next »