Skip to content

Commit

Permalink
all setting/getting user stuff works
Browse files Browse the repository at this point in the history
  • Loading branch information
karina committed Mar 25, 2012
1 parent 2fb2993 commit 5edf855
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions user.php
Expand Up @@ -34,20 +34,33 @@ function getName($userID) {
return $doc;
}
function getNumber($userID) {
$connection = new Mongo();
$db = $connection->allusers->list;
$result = $db->find(array('ID' => $userID));

return $result['number'];
foreach($result as $ob){
$doc = $ob["number"];
}
return $doc;
}
function setNumber($userID, $number) {
$connection = new Mongo();
$db = $connection->allusers->list;
$criteria = array('$set' => array("number"=>$number));

$db->update(array("ID" => $userID), $criteria);

}

function getUserIDbyPhone($phoneNumber) {
$connection = new Mongo();
$db = $connection->allusers->list;
$result = $db->find(array('number' => $phoneNumber));

return $result['ID'];

foreach($result as $ob){
$doc = $ob["ID"];
}
return $doc;
}

function getActiveSigOther($userID) {
Expand Down

0 comments on commit 5edf855

Please sign in to comment.