src/snac/server/database/SQL.php
/**
     * Get user id from user name
     *
     * Return user record based on username aka user name aka userName. Field password is not returned
     *
     * @param string $userName User name, a unique string, probably the user email
     *
     * @return string[] A list with keys: id, active, username, email, first, last, fullname, avatar, avatar_small, avatar_large
     */
Get user id from user name
Return user record based on username aka user name aka userName. Field password is not returned

@param string $userName User name, a unique string, probably the user email

@return string[] A list with keys: id, active, username, email, first, last, fullname, avatar, avatar_small, avatar_large
Get user id from user name Return user record based on username aka user name aka userName . Field password is not returned @param string $userName User name a unique string probably the user email @return string [] A list with keys : id active username email first last fullname avatar avatar_small avatar_large
public function selectUserByUserName($userName)
    {
        $result = $this->sdb->query("select id from appuser where lower(username) = lower($1)",
                                    array($userName));
        $row = $this->sdb->fetchrow($result);
        if ($row && array_key_exists('id', $row))
        {
            $rec = $this->selectUserByID($row['id']);
            return $rec;
        }
        return false;
    }
public function selectUserByUserName ( $ userName ) { $ result = $ this -> sdb -> query ( " select id from appuser where lower(username) = lower($1) " , array ( $ userName ) ) ; $ row = $ this -> sdb -> fetchrow ( $ result ) ; if ( $ row && array_key_exists ( 'id' , $ row ) ) { $ rec = $ this -> selectUserByID ( $ row [ 'id' ] ) ; return $ rec ; } return false ; }
Get user id from user name
 Return user record based on username aka user name aka userName.
Get user id from user name Return user record based on username aka user name aka userName .
/*
             * Call selectUserByID() to avoid all copy/paste code.
             */