Not sure if the title made it clear, but here's what I want to do:
$query = "SELECT ProjID, UserID, ProjDesc, file, OrigProj, OrigUser, ProjDate FROM projects";
$result = mysql_query($query);
I would like to take the field 'UserID', and utilise it for a Query statement to my users table in my database, to read and fill in information to my table, which looks like this:
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo '<table width="100%" border="2" cellspacing="2" cellpadding="2" bgcolor="#84BBD9" bordercolor="#400000">';
echo '<tr>';
echo '<td width="20%">' . $row['UserID'] . ' </td>';
echo '<td width="20%"><a href=/dubious/projects/' . $row['file'] . ' >".' . $row['file'] . ' ."</a></td>';
echo '<td width="20%">' . $row['OrigProj'] . ' </td>';
echo '<td width="20%">' . $row['OrigUser'] . ' </td>';
echo '<td width="20%">' . $row['ProjDate'] . ' </td>';
echo '</table>' ;
}
I have numbers representing the keys for the user table, which in the instance of the 'UserID', is the key autoincrementing column in my users database. I would like to replace this number with the UserName field from the 'users' table of my database. I hope this is clear enough of a question, so how do I do this?
The Current url I am working with is viewable at: http://www.iceregent.com/dubious/MStudio.php
That should give an idea of what I am trying to accomplish, which is replace the numbers with the corresponding data from the selected fields in the database. I dont know the correct 'SELECT_FROM_WHERE' syntax.. 🙁
Thank you kindly.
Ice