List:General Discussion« Previous MessageNext Message »
From:bharani kumar Date:December 13 2009 7:17pm
Subject:Export as csv
View as plain text  
hi friend

Am working in php and mysql, i want to write the join query from the 4
table,

Am very confused how to do ,

Here is the atachment ,

Please tell me , How to to ....

Master table is

CREATE TABLE `med_patient` (
  `id` bigint(20) NOT NULL auto_increment,
  `cInitial` varchar(5) default NULL,
  `cFname` varchar(50) default NULL,
  `cLname` varchar(50) default NULL,
  `cAddress` text,
  `cCity` varchar(50) default NULL,
  `cState` varchar(50) default NULL,
  `cZipcode` varchar(50) default NULL,
  `cTelephone` varchar(50) default NULL,
  `cNextkin` varchar(50) NOT NULL default '',
  `cAlleged` varchar(50) default NULL,
  `cMmrcashworker` varchar(50) default NULL,
  `cDOC` varchar(15) default NULL,
  `cScreenout` varchar(50) default NULL,
  `cScreenoutR` varchar(50) default NULL,
  `cSsn` varchar(50) default NULL,
  `cDOB` varchar(15) default NULL,
  `cDOD` varchar(15) default NULL,
  `cAaddress` text,
  `cAcity` varchar(50) default NULL,
  `cAstate` varchar(50) default NULL,
  `cAzipcode` varchar(50) default NULL,
  `cAtelephone` varchar(50) default NULL,
  `cHospital` varchar(50) default NULL,
  `cHoscashworker` varchar(50) default NULL,
  `cImpaiments` varchar(50) default NULL,
  `cHosamountbill` varchar(50) default NULL,
  `cCurstatus` varchar(50) default NULL,
  `cDOT` varchar(15) default NULL,
  `cScreenoutR2` varchar(50) default NULL,
  `cDODi` varchar(15) default NULL,
  `entryDate` varchar(90) default NULL,
  `entryUser` varchar(50) default NULL,
  `updateDate` datetime default NULL,
  `updateUser` varchar(50) default NULL,
  `ip` double default NULL,
  `sessionid` varchar(200) default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=24 ;



And other table are

CLAIM table


CREATE TABLE `med_claim` (
  `id` bigint(20) NOT NULL auto_increment,
  `paitentid` bigint(20) default NULL,
  `cClaimtype` varchar(30) default NULL,
  `cDatereferal` varchar(15) default NULL,
  `cDateclaimobtained` varchar(15) default NULL,
  `cDatemedicalevidance` varchar(15) default NULL,
  `cDateSSA` varchar(15) default NULL,
  `cSSAclaim` varchar(35) default NULL,
  `cDateinitialdecision` varchar(15) default NULL,
  `cAllowance` varchar(30) default NULL,
  `cDateinitialPERC` varchar(15) default NULL,
  `cDatemedicaidcertification` varchar(15) default NULL,
  `cSSAmedicaidcertification` varchar(35) default NULL,
  `cMMRmedicaidcertification` varchar(15) default NULL,
  `cHospitalmedicaidcertification` varchar(15) default NULL,
  `entryUser` varchar(30) default NULL,
  `entryDate` datetime default NULL,
  `updateUser` varchar(30) default NULL,
  `updateDate` datetime default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `paitentid` (`paitentid`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=21 ;



Invoice table

CREATE TABLE `med_invoice` (
  `invoice_id` int(30) NOT NULL auto_increment,
  `patientid` int(30) default NULL,
  `d_hos_invoiced` varchar(90) default NULL,
  `d_hos_paid_invoiced` varchar(90) default NULL,
  `d_payment_rec` varchar(90) default NULL,
  `d_payment_sent_mmr` varchar(90) default NULL,
  `userid` varchar(30) default NULL,
  `date` varchar(90) default NULL,
  `updateUser` varchar(30) default NULL,
  `updateDate` varchar(30) default NULL,
  `status` int(5) default '1',
  PRIMARY KEY  (`invoice_id`),
  UNIQUE KEY `patient_id` (`patientid`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ;


Remark table
CREATE TABLE `med_remarks` (
  `remark_id` int(30) NOT NULL auto_increment,
  `patientid` int(30) NOT NULL,
  `remark` text NOT NULL,
  `userid` varchar(30) NOT NULL,
  `date` varchar(90) NOT NULL,
  `updateUser` varchar(10) default NULL,
  `updateDate` varchar(90) default NULL,
  `status` int(5) NOT NULL,
  PRIMARY KEY  (`remark_id`),
  UNIQUE KEY `patientid` (`patientid`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=16 ;




I want to render record using join function ,

this record need export as csv

Thanks

Thread
Export as csvbharani kumar13 Dec
  • Re: Export as csvmos13 Dec