Jump to content

php select multiple tables from mysql


tommy445

Recommended Posts

Hello,

 

I am trying to select data from multiple tables with no like fields.

 

this is my code:

$sel = "select * from clients, lenders where client_id='".$_POST['client_id']."'";

 

When I only select from table clients, I get a print out of one record which is right.  However when I select from both tables, I get printouts of the record i want but also printouts of each record in the lenders table.

 

My printout should only be one record.  The one with the client_id.

 

Final Note, I have an html form where I input the client id which sends to the php page.  I'm new to this so I hop my explanation is ok.

Link to comment
https://forums.phpfreaks.com/topic/149153-php-select-multiple-tables-from-mysql/
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.