src/snac/server/database/SQL.php
/**
     * Insert a new user aka appuser
     *
     * Insert a user into the db, returning the new record id.
     *
     * By checking the returned id we at least know a record was updated in the database.
     *
     * @param integer $uid The row id aka user id aka numeric user id
     * @param string $firstName The first name
     * @param string $lastName The last name
     * @param string $fullName The full name
     * @param string $avatar The avatar
     * @param string $avatarSmall The small avatar
     * @param string $avatarLarge The large avatar
     * @param string $email The email address
     * @param string $userName The user name
     * @param string $workEmail Work email
     * @param string $workPhone Work phone
     * @param integer $affiliationID Constellation ID aka ic_id integer version_history.id
     * @param string $preferredRules Preferred name descriptive rules.
     * @param boolean $active Is the user active
     * @return boolean Whether the SQL statement succeeded
     */
Insert a new user aka appuser
Insert a user into the db, returning the new record id.

By checking the returned id we at least know a record was updated in the database.


Insert a new user aka appuser Insert a user into the db returning the new record id . By checking the returned id we at least know a record was updated in the database .
public function updateUser($uid, $firstName, $lastName, $fullName, $avatar, $avatarSmall, $avatarLarge, $email, $userName,
                               $workEmail, $workPhone, $affiliationID, $preferredRules, $active)
    {
        $result = $this->sdb->query(
            'update appuser set first=$2, last=$3, fullname=$4, avatar=$5, avatar_small=$6,
            avatar_large=$7, email=$8, userName=$9, work_email=$10, work_phone=$11, affiliation=$12,
            preferred_rules=$13, active=$14
            where appuser.id=$1 returning id',
            array($uid,
                  $firstName,
                  $lastName,
                  $fullName,
                  $avatar,
                  $avatarSmall,
                  $avatarLarge,
                  $email,
                  $userName,
                  $workEmail,
                  $workPhone,
                  $affiliationID,
                  $preferredRules,
                  $this->sdb->boolToPg($active)));
        $row = $this->sdb->fetchrow($result);
        if ($row && array_key_exists('id', $row))
        {
            return true;
        }
        return false;
    }
public function updateUser ( $ uid , $ firstName , $ lastName , $ fullName , $ avatar , $ avatarSmall , $ avatarLarge , $ email , $ userName , $ workEmail , $ workPhone , $ affiliationID , $ preferredRules , $ active ) { $ result = $ this -> sdb -> query ( 'update appuser set first=$2, last=$3, fullname=$4, avatar=$5, avatar_small=$6,
            avatar_large=$7, email=$8, userName=$9, work_email=$10, work_phone=$11, affiliation=$12,
            preferred_rules=$13, active=$14
            where appuser.id=$1 returning id' , array ( $ uid , $ firstName , $ lastName , $ fullName , $ avatar , $ avatarSmall , $ avatarLarge , $ email , $ userName , $ workEmail , $ workPhone , $ affiliationID , $ preferredRules , $ this -> sdb -> boolToPg ( $ active ) ) ) ; $ row = $ this -> sdb -> fetchrow ( $ result ) ; if ( $ row && array_key_exists ( 'id' , $ row ) ) { return true ; } return false ; }
Insert a new user aka appuser
 Insert a user into the db, returning the new record id.
Insert a new user aka appuser Insert a user into the db returning the new record id .