How can I select in php the id which is logged in?

Sultan

New member
I made a user registration page in HTML and PHP. The data of user registration(id auto increment and other information) stores in mysql table called "users". I also have another table called "profile". When user get registered, the id of user also goes into "profile" id field. The "profile" table have three fields(id, firstname, lastname). Now I want to ask that when user logged in and let suppose it's id is 1 or 2 or any, how can I select the id of logged in user that when loggen in user fill in his firstname and lastname at his profile page, it should save exactly in logged in user id's row and should I make the firstname and lastname fields null or not null?
 
Back
Top