Jump to content

[SOLVED] HELP With Joining Two Tables


JSHINER

Recommended Posts

I have the following:

 

function getListings($db, $zip= false) {

$arr = $db->getArray("SELECT * FROM listing_table WHERE ZIP_CODE = '$zip' ORDER BY price DESC");

return $arr;

}

$page['listing'] = getListings($db, $_GET['zip']);

foreach ($page['listing'] as $z) { echo ....

 

And it returns everything fine. However, some fields in the listing_table define something as "H9595595" and in another table, lets call it member_table, that "H9595595" could be used to get their name, address, etc.

 

So my question is, how can I get those two tables to communicate so in the foreach I can also return corresponding member information. So instead of returning "Field 1, Field 2, H9595595" if would return "Field 1, Field 2, John Smith"

 

Link to comment
https://forums.phpfreaks.com/topic/48951-solved-help-with-joining-two-tables/
Share on other sites

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.