|
Posted by cresh on 05/03/07 18:40
Just in case anyone else needs this type of code, here is my small
example, thanks to the help received here. The reference to
"require.php" is where I store my database and server information,
such as dbase name, user, password, etc.
Thanks again for the assistance, it works great.
Cresh
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Retrieve Information</title>
</head>
<body>
<? require('require.php');
$link = mysql_connect($dbasehost, $dbaseuser, $dbasepass);
if (!$link) {
die('Could not connect to the database. Error is: ' .
mysql_error());
}
mysql_select_db($dbasename);
?>
<form name"myform" action="file.php" method="post">
<p>Make a selection: <select name="program">
<?
$r = mysql_query("select information from info");
while($row = mysql_fetch_assoc($r))
{
echo "<option
value='{$row['information']}'>{$row['information']}</option>";
}
?>
</select></form>
</body>
</html>
Navigation:
[Reply to this message]
|