i have this code
<body>
<?php
include 'cms/core/config.php';
include 'cms/core/opendb.php';
$query = "SELECT id, language, updated ". "FROM meta ". "WHERE id = '5'";
$result = mysql_query($query) or die('Error : ' . mysql_error());
list($id, $language, $updated) = mysql_fetch_array($result, MYSQL_NUM);
include 'cms/core/closedb.php';
?>
<form method="post" action="default.php?s=editmeta">
<input type="hidden" name="id" value="5">
<table width="700" border="0" cellpadding="5" cellspacing="0" class="box">
<tr>
<td width="100" valign="top">Language:</td>
<td>
<select name='language' id="language" >
<option value="bg">Bulgarian</option>
<option value="cs">Czech</option>
<option value="da">Danish</option>
<option value="de">German</option>
<option value="el">Greek</option>
<option value="en" selected>English</option>
<option value="en-gb">English (UK)</option>
<option value="en-us">English (US)</option>
<option value="es">Spanish</option>
<option value="fi">Finnish</option>
<option value="hr">Croatian</option>
<option value="it">Italian</option>
<option value="fr">French</option>
<option value="fr-ca">French (Quebec)</option>
<option value="ja">Japanese</option>
<option value="ko">Korean</option>
<option value="nl">Dutch</option>
<option value="no">Norwegian</option>
<option value="pl">Polish</option>
<option value="ru">Russian</option>
<option value="sv">Swedish</option>
<option value="zh">Chinese</option>
</select> </td>
</tr>
<tr>
<td colspan="2" align="center"><input name="update" type="submit" id="update" value="Update Content"></td>
</tr>
</table>
</form>
</body>
</html>
basically before this page i have another to post your selected language to the db. the page pasted below is the edit page where you can you can change your language. what i want is that if in the first page you choose danish for instance and then you want go to change it at al later time it remembers that you had choosen danish.
i think i had found a script but couldnt understand how to implement it as im still green in php the script im talking about is in the following:
<?php
$link=mysql_pconnect("localhost","user","password");
mysql_select_db("db",$link);
$result = mysql_query("select date_format(birth_date,'%Y') as birth_year from members where member_id=1");
$row=mysql_fetch_array($result); // fetch first row
$year=$row["birth_year"]; // retrieve 4-digit year of birth
// display combo: current year -> -100
$current_year=date("Y");
echo '<select name="cbo_year">';
for ($i = $current_year; $i >= ($current_year-100); $i--) {
echo '<option '.($year == $i ? ' selected ' : '').' value="'.$i.'" >'.$i.'</option>';
}
echo '</select>';
?>
just for you to know the table name is meta and the field is language. i will be glad if somebody help me out as im really stuck on this one! thanks alot in advance guys!