I am trying to grab data from 2 tables at the same time.
Here is the code I am using:
$sql = "Select customer_table.*, profile.* from customer_table, profile WHERE (profile.age BETWEEN '$start_age' AND '$end_age')
&& customer_table.seeking =\"$seeking2\" ";
$result = @mysql_query($sql,$db)or die("$sql");
while ($row = mysql_fetch_array($result)){
$field1 = $row[('customer_table.customer_username')];
echo "$field1";
}
I know the $sql is working fine because if I run it in MySQL it returns a result. I think my problem is with the $row variable. How should I write the row variable to select different fields from each of the two tables?
Thanks