public static function do_exist( $username, $password ) { $query = DB::select( 'id' ) ->from( 'users' ) ->where( 'username', '=', $username ) ->where( 'password', '=', sha1( $password ) ); return (boolean) $query; }P.S. I used this for guidlines to DB class.
$user = \DB::select() ->where('username', '=', $username_email) ->or_where('email', '=', $username_email) ->from(\Config::get('simpleauth.table_name'))->execute(); if($user->count() > 0) { echo 'user found'; } else { echo 'no user foudn'; }
public static function valid_combo( $username, $password ) { $query = DB::select( 'id' ) ->from( 'users' ) ->where( 'username', '=', $username ) ->where( 'password', '=', sha1( $password ) ) ->execute(); if( $query->count() !== 0 ) { return true; } }
public static function valid_combo( $username, $password ) { $query = DB::select( 'id' ) ->from( 'users' ) ->where( 'username', '=', $username ) ->where( 'password', '=', sha1( $password ) ) ->execute(); return $query->count() > 0; }
It looks like you're new here. If you want to get involved, click one of these buttons!