Hi,
I've created a drop down menu that gets it's values (ID and SCHOOL) from a MYSQL database. I've created a variable for the ID value, but can't figure out how to do this for the SCHOOL value.
The code ...
[php]<?php
$sql = "SELECT ID, SCHOOL FROM SCHOOL ORDER BY ID";
$users = mysql_query($sq l,$conn);
while($row = mysql_fetch_arr ay($users))
{
echo ("<option value=\"$row[ID]\" " . ($schooladd == $row["ID"] ? " selected" : "") . ">$row[SCHOOL]</option>"); }
?>[/php]
I'm sure it's something simple, but I've been looking at it for so long I just can't see it - any ideas ?
Please enclose your posted code in [code] tags (See How to Ask a Question).
This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.
Please use [code] tags in future.
MODERATOR
I've created a drop down menu that gets it's values (ID and SCHOOL) from a MYSQL database. I've created a variable for the ID value, but can't figure out how to do this for the SCHOOL value.
The code ...
[php]<?php
$sql = "SELECT ID, SCHOOL FROM SCHOOL ORDER BY ID";
$users = mysql_query($sq l,$conn);
while($row = mysql_fetch_arr ay($users))
{
echo ("<option value=\"$row[ID]\" " . ($schooladd == $row["ID"] ? " selected" : "") . ">$row[SCHOOL]</option>"); }
?>[/php]
I'm sure it's something simple, but I've been looking at it for so long I just can't see it - any ideas ?
Please enclose your posted code in [code] tags (See How to Ask a Question).
This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.
Please use [code] tags in future.
MODERATOR
Comment