-7
For those with the doubt as I had, below I’ll leave the code ready, just change to your project. The code is simply to know the user logged in and say his name in PHP PDO. If your project is by cookie dara certain, if it is Session adapt your code to my.
//USERNAME
$sql= "SELECT * FROM nomedasuatabela WHERE email='$login_cookie'";
$stmt = $conexao->prepare($sql);
$stmt->bindParam(':email', $login_cookie, PDO::PARAM_INT);
$stmt->execute();
If you want to answer the question itself no problem, just separate the text of the question and the answer in the respective fields, now question and answer only in the area/field of "question" is not valid. There is an error there in your code you cannot associate a bind if it does not exist in the SQL statement. The site works different from a forum see the differences in tour if you have any questions let us know, you can call a specific user like this
@nomeDoUsuario
.– rray
I am voting to close this question as out of scope because it is not a question per se, but a hint.
– gmsantos