I have a table named revenue in a mysql database, i need to display the columns and data in the form if a table. So far i'm simply echoing the data in the below code. Help is appreciated.
<?php
include('adodb/adodb.inc.php');
echo 'To See existing records';
$db=NewADOConnection('mysql');$db->Connect("127.0.0.1", "vpp", "abcd", "vpp");
$sql="select * from revenue";
$result = $db->Execute($sql);
if ($result === false) die("failed2");
$records=array();
$count=$result->RecordCount();
echo "Total Records Found :".$count."<br>";
if($count > 0) {
for ($x=0;$x<$count;$x++) {
$offerId=$result->fields[0];
$affId=$result->fields[1];
$status=$result->fields[2];
$deduction=$result->fields[3];
echo "OfferId:".$offerId." and AffId:".$affId." with deduction %:".$deduction." status=".$status."<br>"; // Need this data to be dispalyed in a table
$rec=array("offerId"=>$offerId,"affiliate_id"=>$affId,"status"=>$status, "deduction"=>$deduction);
array_push($records,$rec);
$result->MoveNext();
}
}
?>