I have read many posts like this and can not get this to work right. The box always remains empty, yet there are rows in the table. Any help would be appreciated. Thanks.
<?php
//Variables for mysql database connection
$user='testuser';
$password='testpass';
// connect to MySQL
$connection = mysql_connect(localhost, $user, $password);
if (!$connection) {
die('Could not connect: ' . mysql_error());
}
$result = mysql_query ("select Name from dba.wx_faq_backup group by Name");
echo "<select name=DB_Backup value=''>Database Backup</option>";
// printing the list box select command
while($nt=mysql_fetch_array($result)){//Array or records stored in $nt
echo "<option value=$nt[Name]</option>";
/* Option values are added by looping through the array */
}
echo "</select>";// Closing of list box
mysql_free_result($result) ;
?>