Hi All,I have a Managers table in my SQL DB and it has a ManagerID, MgrName and MgrPhoto field base...I can code a form with a select button that displays a drop down with the managers in it as choices, but am a little confused as to how I would make the PHOTO (MgrPhoto) change to the corresponding ManagerID that is selected from that option drop down since the SELECT CODE in the form only queries the ManagerID / MgrName combo for the choice.. The photo is below that drop down box and does anyone know how to make it change to whatever photo is assigned to the selected ManagerID / MgrName ???Here is the form code with query :<form enctype="multipart/form-data" action="updatemanagerphoto.php" method="POST"> <select name="ManagerID" id="manager" style="width:400px" class="form_textbox"> <? $db_connect = mysql_connect($db_host, $db_username, $db_password); mysql_select_db($db_name, $db_connect) || die(mysql_error()); $sql_query = "SELECT * FROM Managers ORDER BY MgrName ASC"; $result = mysql_query($sql_query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ $row = decode_array($row); $ManagerID = $row['ManagerID']; $MgrName = $row['MgrName']; $MgrPhoto = $row['MgrPhoto']; ?> <option value="<?= $ManagerID; ?>"><?= $MgrName; ?></option> <? } mysql_close($db_connect); ?> </select> <br/> <br/> Current Image (if exists) :<br/> <? $db_connect = mysql_connect($db_host, $db_username, $db_password); mysql_select_db($db_name, $db_connect) || die(mysql_error()); $sql_query = "SELECT MgrPhoto FROM Managers WHERE ManagerID='$ManagerID'"; $result = mysql_query($sql_query) or die(mysql_error()); $sql = mysql_query($query); while ($row = mysql_fetch_array($query)){ $MgrPhoto = $row['MgrPhoto']; } mysql_close($db_connect); ?> <? if (file_exists("../files/mainmanagerphoto/$MgrPhoto")) { ?><img src="../files/mainmanagerphoto/<?= $MgrPhoto ?>" width="200px" height="200px"> <? } ?><br/><br/><br/> New Manager Photo: <input type="file" name="photo"><br> <br> <input type="submit" value="Add"> </form>
James Smith