I am trying to display my sql data in column wise. currently the output is
Customer Name Amount Date XYZ 1200 2015.01.01 XYZ 600 2015.01.02
But i want to display like:
2015.01.01 2015.01.2 XYZ 1200 600
My code is as below:
<!-- language: lang-html -->
<table border="0" id="info">
<?php
$conn = mysql_connect('localhost','root','test');
if(!$conn) die("Failed to connect to database!");
$status = mysql_select_db('tulient', $conn);
if(!$status) die("Failed to select database!");
$sql = mysql_query("select * from add_deposite where CUSTOMER_NAME like '%$term%' and DATE between '$term1' and '$term2'");
$rs = mysql_query("select * from add_deposite where CUSTOMER_NAME like '%$term%' and DATE between '$term1' and '$term2' ");
$CUSTOMER_NAME = "";
while($row = mysql_fetch_array($rs))
{
echo '<tr>';
echo '<td><div align="left">'.$row['CUSTOMER_NAME'].'</div></td>';
echo '<td><div align="left">'.$row['AMOUNT'].'</div></td>';
echo '<td><div align="left">'.$row['DATE'].'</td>';
echo '</tr>';
}
?>
</table>
Your valuable advice is necessary to complete my task. thanks in advance.
Ripon