Hi all, I am currently trying to populate a dropbox with values from a MSSQL DB. The values that are being brought back from the table are two words - peoples full names, eg 'John Smith' (in the one field). My problem is that using the code below, only the person's first name is being posted to the subsequent page and the surname is lost. Does anyone know what is wrong with this code? I'm pretty sure it has somethin to do with the fact there is a space in the field value...
[php]
<?php
$myServer = "...";
$myUser = "...";
$myPass = "...";
$myDB = "...";
$link = mssql_connect( $myServer, $myUser, $myPass );
mssql_select_db( $myDB, $link );
$output = mssql_query("SELECT name FROM staff");
?>
<select name="requestedby" id="requestedby">
<?php while ($row = mssql_fetch_object($output)) { echo "<option value=" . $row->name . ">" . $row->name . "</option>"; } ?>
</select>[/php]
Please enclose any code within the proper code tags. See the Posting Guidelines on how to do that.
moderator