MySQL Forums
Forum List  »  Quality Assurance

fetching the result
Posted by: anand perumal
Date: December 13, 2011 10:44PM

hello,

Pls help me... Almost in all my projects I have a problem.. That may ba a silly question.. but i need a soultion for this...

I have two tables like patient masters and history masters...


Patient masters

id patient_name
1 Anand
2 Bala
3 Selva


History Masters

id date patient_id
1 2011-5-3 1
2 2011-5-4 1
3 2011-5-6 2
4 2011-6-5- 1
5 2011-7-7 2
6 2011-8-8 3
7 2011-8-8 2


I need to join two tables and want to get result like the following

Name Days
2011-5-3
Anand 2011-5-4
2011-6-5

2011-5-6
Bala 2011-7-7
2011-8-8

Selva 2011-8-8


I mean i m always getting a result in an array.. I want to get the result with array and inner array....

$result =array('id'=>1,'Name'=>'Anand','history'=>array('1'=>'2011-5-3','2'=>'2011-5-4','3'=>'2011-6-5'))

I m using PHP

pls help me...

Thanks
-Anand

Options: ReplyQuote


Subject
Views
Written By
Posted
fetching the result
1622
December 13, 2011 10:44PM
1007
December 19, 2011 08:48PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.