Hi,
I'm trying to build a select option field, from 2 tables, so after a user logs in, a select field will be build based on their user_id. Table1 has user info, (username/password/user_id), Table2 has the options for each user, (user_id/option_value/option_description).
So far I have...
<SELECT NAME="room_type">';
mysql_select_db("dbname");
$sql="SELECT option_value, option_description FROM table2, hotels WHERE user_id = user_id";
{
while ($row=mysql_fetch_array($result,MYSQL_ASSOC))
{
echo "<OPTION VALUE=http://www.phpbuilder.com/board/archive/index.php/".$row['code_id'].">".$row['room_type']."</option>";
};
}
else
{
echo mysql_error();
};
'</select>
But this gives a parse error can anyone see something wrong?
I'm trying to build a select option field, from 2 tables, so after a user logs in, a select field will be build based on their user_id. Table1 has user info, (username/password/user_id), Table2 has the options for each user, (user_id/option_value/option_description).
So far I have...
<SELECT NAME="room_type">';
mysql_select_db("dbname");
$sql="SELECT option_value, option_description FROM table2, hotels WHERE user_id = user_id";
{
while ($row=mysql_fetch_array($result,MYSQL_ASSOC))
{
echo "<OPTION VALUE=http://www.phpbuilder.com/board/archive/index.php/".$row['code_id'].">".$row['room_type']."</option>";
};
}
else
{
echo mysql_error();
};
'</select>
But this gives a parse error can anyone see something wrong?