The php login thought for a long time, but there was no result. The problem was as follows: to create a PHP + mysql chat room, you have to log in first to enter the chat room, one table records the user registration information one table records the user's speech information the question now is how to output a speech with the user name can only output the speech, because after the speech is recorded to the database and then output from the database, I don't know how to output a speech with a user name. I want to achieve this by using the user name + the speaker. I don't know how to contact the user name and the method used to speak in a php login.
I thought about it for half a day. I don't have any results. please try again.
The problem is as follows:
To create a PHP + mysql chat room, you must log on to the room first,
One table records user registration information
One table records the user's speech information
The question is how to output a speech with a user name
Currently, only speeches can be output, because the speeches are recorded in the database and then output from the database,
I don't know how to output a speech with a user name,
The method to achieve this is user name + speech
I don't know how the user name is associated with the speaker.
It is like a lot of websites that output comments with user names after login. I don't know how to implement it ..
------ Solution --------------------
... What is the idea? After logon, the user name is saved in session.
Add $ _ SESSION ['username'] to the output. isn't that enough?