Skip to content

Instantly share code, notes, and snippets.

@web-zen
Created August 29, 2009 19:54
Show Gist options
  • Select an option

  • Save web-zen/177653 to your computer and use it in GitHub Desktop.

Select an option

Save web-zen/177653 to your computer and use it in GitHub Desktop.
<?php
$SQL="SELECT UserID, CONCAT(LastName, ',', Firstname) AS FullName FROM Users ORDER BY LastName, FirstName";
// prepare statement
if ($stmt = $oTechdocs->prepare($SQL)) {
$stmt->execute() or die ("Could not execute statement"); // execute prepared statement
$stmt->bind_result($UserID, $FullName);
while ($r = $stmt->fetch()) {
echo '<option value="',$UserID,'">',$FullName,'</option>';
}
$stmt->close(); // close statement
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment