juggernautsei wrote on Thursday, June 07, 2012:
Hi,
I have been trying to get the Provider NPI list to show up in alphabetical order. I added the ASC to the sql query and the list is still in random order.
// provider list, including address book entries with an NPI number
else if ($data_type == 11) {
$ures = sqlStatement("SELECT id, fname, lname, specialty FROM users " .
"WHERE active = 1 AND ( info IS NULL OR info NOT LIKE ‘%Inactive%’ ) " .
“AND ( authorized = 1 OR ( username = ‘’ AND npi != ‘’ ) ) " .
“ORDER BY lname, fname ASC”); //Added to sort the list aphabetically
echo “<select name=‘form_$field_id_esc’ id=‘form_$field_id_esc’ title=’$description’>”;
echo “<option value=’’>” . htmlspecialchars( xl(‘Unassigned’), ENT_NOQUOTES) . “</option>”;
while ($urow = sqlFetchArray($ures)) {
$uname = htmlspecialchars( $urow . ’ ’ . $urow, ENT_NOQUOTES); //This is where the sort gets undone.
$optionId = htmlspecialchars( $urow, ENT_QUOTES);
echo “<option value=’$optionId’”;
if ($urow == $currvalue) echo " selected”;
echo “>$uname</option>”;
}
echo “</select>”;
How would I get this to show in alphabetical order?
Sherwin
OpenMedPractice.com