Forum Moderators: coopster
Any help will be appreciated.
Cor
We have a great library thread on the basics of extracting data from mysql [webmasterworld.com]. Read up on the basics. Once you have them down, to put the content into a 'select', you have to echo each 'option' in the while loop.
Here is my code:
<?
//make the connection to the database
$connection = @mysql_connect($server, $dbusername, $dbpassword) or die(mysql_error());
$db = @mysql_select_db($db_name,$connection)or die(mysql_error());
//make query to database
$sql ="SELECT course FROM coursetable WHERE user= '$_SESSION[user_name]'";
//$result = @mysql_query($sql,$connection) or die(mysql_error());
$query = mysql_query($sql);
while ($row = mysql_fetch_array($query)) {
echo "<p>",$row['course'];
}
?>
I need to populate my selectbox with ,$row['course']. Is it possible?
Thank you.