Easy quest using SQL request with PHP. Transfer a lot of valors beteen
tables in a variable or array.....how?
I have two SQL tables. The first one structure is simple. Just "ID of
user" and "Name". The second one is simple too. "ID of the comment" and
"The comment" and "ID of the creator". I want to show in my site all the
comments that correspond with the "ID of user"
The probleme is we have here a lot of ID and two different tables.
Somethink like that:
$1= $bdd->query("SELECT * FROM comments WHERE id_user=220281");
$2=$1->fetch();
But its imposible because id user is not on the comments table.
I hope you may help me. Thank you.
No comments:
Post a Comment