|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
MySQL 4.1 - Query-retrive data from 2 tables
Hi Guyes,
I've 2 tables say 'order' & 'customer'. some fields in customer are:cid,cname,discount & in 'order': labno,caname,total. there is a field 'discount' in customer. I've declared a field as 'labno' in a upd.php page. I want a query to retrive data from both tables so I can use 'discount' value of customer table for some calculation purpose in order table. Here I want to retrive value from both tables only using 'labno' in upd.php page. So, Help if possible... |
|
#2
|
||||
|
||||
|
You need to join the tables on the foreign key (AKA the field that links one record from one table to another record in another table). It isn't particularly hard to do if you read this basic explanation of Joins.
Try your hand at writing the query after reading that and if you can't do it - let us see what you have and we can help iron out any wrinkles you have.
__________________
life is a game.... Have fun ----------------------------- http://www.phpwomen.org strength in unity PHPCommunity IRC #phpc on freenode |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > MySQL 4.1 - Query-retrive data from 2 tables |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|