First, what is table 2 for? You don't really seem to be using it in your query.
Plus, I don't know if you can combine two rows into one field as you are attempting to do it.
Third, I'm not sure that your query statement makes any sense:
$query= "SELECT * FROM table1, table2 WHERE
table1.Field1 = $Field1 AND
table1.Field2 = table1.Field2 AND
table1.Field3 = $Field3";
where table1.Field2 = table1.Field2?
That is an uneccessary line...?
I think you would have to do this:
//make your databse connection
$dbh=mysql_connect ($servername, $dbusername, $dbpassword);
//query your database
$query = "SELECT * FROM table1 where Field1 = '$field1' and Field3 = '$Field3'";
$result = mysql_db_query ($dbname,$query);
//error checking
if($result == false){
echo mysql_errno().":".mysql_error()."<BR>";
exit;
}
//initiate a variable to use later
$Field5 = "";
//loop through to get all your rows
for ($i = 0; $i <$numofRows; $i++){
$Field4 = mysql_result($result,$i, "Field4");
//If you want to combine all your rows into one variable
$Field5 .= $Field4
}
That should get the job done.
I can asume that you are only getting one record back as recordsets are stored in arrays. So you have to get the data back by row....