Query within to separate tables, Need help
I have one table1 with four fields (field1, field2, field3, field4) and table2
with two fields (field1, field2).
As I would like to retrive information from table1 it will work:
$username=$_POST['fname'];
$query1 = "SELECT * FROM users
WHERE ime='$username'";
$result1 = mysql_query($query1) or die ("SQL error: $query -- " . mysql_error());
while ($row = mysql_fetch_array($result1))
{
$IDuser = $row["ID"];
$email = $row["email"];
}
But how to retrieve information from table 2 if this is another table and
it should retrieve last record in this table2 where is $IDuser from table 1.
Please help...