// Connect to database
$dbhost = "localhost";
$dbuser = "username";
$dbpass = "password";
$dbname = "databasename";
$db = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname,$db);
/*
select all rows from the language table and place
the table attribute lang_abbreviation into array $langAbbreviation
*/
$sql1 = "SELECT * from language ";
$result1 = mysql_query($sql1, $db);
$langCount = mysql_num_rows($result1);
for ($i=0; $i < $langCount; $i++) {
$row = mysql_fetch_array($result1);
$langAbbreviation[$i] = $row["lang_abbreviation"];
}
// show the array on your page
for ($i=0; $i < $langCount; $i++) {
echo $langAbbreviation[$i] ;
}
:)
|