Greetings,
I am trying to create an online form, and use a mysql data base table to supply options in a drop box style form. I have eight entries in my database table to choose from. When I load my "optionbox.php" page, it has none of my options. The table type is "MyISAM", the field type is "varchar(30), and default is "NULL". Here is the code source I am using in my php file.
PHP Code:
<?php
@ $db = mysql_pconnect(localhost,database_name,pass_word);
if (!$db)
{
echo Could not connect to database. Please try again later. ;
exit;
}
mysql_select_db(database_name);
$result = mysql_query(SELECT field_name FROM table_name);
while ($row = mysql_fetch_row($result))
{
echo <option>;
echo $row[field_name];
echo </option>
;
}
?>
Looking at my browser source code, I can see I have my eight entries count, but no supplied data between the eight <option></option> tags.
Here is the browsers source html code:
Code:
<!-- Start of FORM -->
<form method="POST" action="results.php">
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
</form>
<!-- End of FORM -->
Thanks in advance for help,
Jerry
Greetings,
I am trying to create an online form, and use a mysql data base table to supply options in a drop box style form. I have eight entries in my database table to choose from. When I load my "optionbox.php" page, it has none of my options. The table type is "MyISAM", the field type is "varchar(30), and default is "NULL". Here is the code source I am using in my php file.
PHP Code:
<?php
@ $db = mysql_pconnect(localhost,database_name,pass_word);
if (!$db)
{
echo Could not connect to database. Please try again later. ;
exit;
}
mysql_select_db(database_name);
$result = mysql_query(SELECT field_name FROM table_name);
while ($row = mysql_fetch_row($result))
{
echo <option>;
echo $row[field_name];
echo </option>
;
}
?>
Looking at my browser source code, I can see I have my eight entries count, but no supplied data between the eight <option></option> tags.
Here is the browsers source html code:
Code:
<!-- Start of FORM -->
<form method="POST" action="results.php">
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
</form>
<!-- End of FORM -->
Thanks in advance for help,
Jerry
|
|
Search Webmaster Help and Solution
forms drop box problemRelated ItemsQuery failed: connection to localhost:3354 failed (errno=111, msg=Connection refused). |
