I need to create a summary page based on several different tables, but need to show all the information on one page.
What would be the best way to create a page like this? So far I have created a custom php page for this - but it would be nice to have it look like a "list page"
On the summary page I need to calculate several values via mysql:
- Total outstanding Jobs
- Total jobs not invoiced
- Total amount of domains expiring this week
- Total turnover this month
(This I can do - no -problem)
My question:
- Using the custom page - how do I tap into the build-in phpRunner database connection or do I have to specify it like below?
Currently I am using this:
// OUR MAIN CONNECTION
$host="locahost";
$user="username";
$pwd="password";
$port="";
$sys_dbname="mydqlDB";
2.My second question is how do I display the result of a mysql count statement?
$sql = "Select count(*) as domCount from domainnames"
****I have tried several options, but cannot get to show the count value**
$rs=CustomQuery($sql);
$data=db_fetch_array($rs);
$row = mysql_fetch_assoc($data);
// $row = mysql_fetch_field($data['domCount']);
// $num = $row['domCount'];
// $rsExists = db_query($strSQLExists,$conn);
// $data=db_fetch_array($rsExists);
end*****
This code is working, I can see the retrieved list of transactions:
$sql = "select * from domainnames";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "id: " . $row["domainID"]. " - Name: " . $row["domnme"]. " " . $row["type"]. "
";
}
} else {
echo "0 results";
}
Any assistance will be appreciated.