Skip to content

Instantly share code, notes, and snippets.

@adamgoose
Created November 1, 2012 02:59
Show Gist options
  • Save adamgoose/3991376 to your computer and use it in GitHub Desktop.
Save adamgoose/3991376 to your computer and use it in GitHub Desktop.
<?php
$sql = "SELECT * FROM `givers`";
if($givers = mysql_query($sql)) {
$return = "[";
while($giver = mysql_fetch_array($givers)) {
$return .= "'".$giver['last'].", ".$giver['firsts']."', ";
$json[$giver['last'].", ".$giver['firsts']] = $giver['id'];
}
$return = substr($return, 0, -2)."]";
echo "namepick = ".$return.";"."\n";
echo "namepickid = ".json_encode($json).";";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment