Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Check if user exists Reply To: Check if user exists

#169206
__
Participant

best way to check if a user exists (by their user ID)

I’d say something like select 1 from user where id=:id. Using the Kirby db class, I guess it would be something like:

$id = "desired_user_id";
db::select( "name_of_user_table","'1'",["id"=>$id]  );

// or, if Kirby can't deal with selecting literals
db::select( "name_of_user_table","id",["id"=>$id] );

and …check to see what needs to be updated.

What do you mean by “needs to be updated”? not filled out yet? filled out too long ago?

Once you can qualify it, we should be able to build it into the query.