Hi Dear all
Its my table structure...

CREATE TABLE IF NOT EXISTS `limsrentpayment` (
  `PaymentMonth` varchar(15) NOT NULL,
  `SiteID` varchar(15) NOT NULL,
  `DurationS` varchar(25) NOT NULL,
  `DurationE` varchar(25) NOT NULL,
  `Amount` varchar(15) NOT NULL,
  `pDate` date NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

and data stored in it

INSERT INTO `limsrentpayment` (`PaymentMonth`, `SiteID`, `DurationS`, `DurationE`, `Amount`, `pDate`) VALUES
('Dec-09', 'C-LHR-7300', '1-Dec-09', '30-Nov-10', '252,000.00', '2009-11-23'),
('Nov-09', 'C-ADP-5900', '8-Nov-09', '7-Nov-10', '152,769.00', '2009-11-12'),
('Nov-09', 'C-BAX-5825', '9-Nov-09', '8-Nov-10', '105,840.00', '2009-11-12');

another table is

CREATE TABLE IF NOT EXISTS `limscheaquesdispatched` (
  `SiteID` varchar(12) NOT NULL,
  `BaseAmount` varchar(25) NOT NULL,
  `cDate` date NOT NULL,
  `DurationSY` varchar(25) NOT NULL,
  `DurationEY` varchar(25) NOT NULL,
  `BatNo` varchar(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

and values are

INSERT INTO `limscheaquesdispatched` (`SiteID`, `BaseAmount`, `cDate`, `DurationSY`, `DurationEY`, `BatNo`) VALUES
('C-LHR-7300', '208,596.00', '2009-12-07', '09', '10', 'BAT364'),
('C-ADP-5900', '212,700.00', '2009-12-07', '09', '10', 'BAT364'),
('C-BAX-5825', '158,322.00', '2009-12-07', '09', '10', 'BAT364');

Now For one year I can easily show
Year, Due Date ,Date Sent To Finance, Date Returned From Finance, Date Resubmitted To Finance, Date Cheque Issued, Date Cheque Received by Owner, Payment Status

But I have to show it for more years.
Please check attached image.
I am confused.....!!!
For showing like this how I can store Data, i means structure of DB.

Recommended Answers

All 9 Replies

Are you confused with report query or data structure?

Are you confused with report query or data structure?

I am confused about report .
I want to show record in table.

I want result like this...
Please also check Previous attached image for the reference.
I need a resullt in each cell from DB using different query.

Please check my result...

select * from lease_tablen
while loop{}

If you have one table per cell, then this design is very poor.?
Even though you may execute query using two for loops

$rows=find number of year rows for particular user;
$cols=8; //year,due date, date sent etc
for ($rowindex=1;$rowindex<=$rows;$rowindex++)
{
 	print "<tr>";
	for ($colindex=1;$colindex<=$cols;$colindex++) 
	{
		$queryresult="select * from table".$rowindex*$colindex;// this will give appropriate table name for your cell
		//execute above query here
		print "<td>{$result}</td>";
	}
	print "</tr>";
}

above code is not syntatically correct.

if i will use one table per cell or Div is it right approach?

I dont think keeping one table per cell in database is a right approach.

But I want to view, my table structure is OK.

Then you may use code in post no #6 of this thread.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.