Jump to content

mysql_fetch_array from multiple table


andros_k

Recommended Posts

If you write a query like:

 

$sql = "SELECT a.id, a.name, b.id, b.surname FROM table1 a, table2 b WHERE b.id = a.id";
$res = mysql_query($sql);
//Validate the $res
while ($row = mysql_fetch_array($res)) {
  var_dump($row)
}

 

It will work. The problem is on writing the right query with right joins.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.