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.
Edit #4:
I was wrong in Edit #3. Just kill me! My bad...
P.S. Without as_array() it's variable that contains object. $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;
}
Thanks again. )) It looks like you're new here. If you want to get involved, click one of these buttons!