I have 2 tables (Users, Wall). The UserID in the Wall table is a foreign key. How would I go about fetching the users details using this? (I want to fetch the users Forename
As here the main target are messages you write in a sql query first the table with message, in your example Wall table and the query can look like this:
$result = mysql_query ("SELECT u.Forename, u.Surname, w.Message FROM Wall AS w INNER JOIN Users AS u ON(w.UserID=u.UserID)");
Now when output use:
=stripslashes($row['Surname'])?>
=stripslashes($row['Lastname'])?>
=stripslashes($row['Message'])?>
Of course do the proper formatting.