<?php
$db = new mysqli('localhost', 'xxxx', 'xxxxxxxxxx','xxxxx');
if (mysqli_connect_errno()) {
echo 'Error: Could not connect to database. Please try again later.';
exit;
};
$result4=mysqli_query($db,"SELECT work_order_uids, work_order_job_code_desc,
wo_surface_code_description,account_name
FROM wo_table, wo_stats, acitve_sites_table, accounts_table, wo_surface_code, work_order_job_codes
WHERE wo_table.work_order_uids = wo_stats.work_order_uid
AND wo_stats.active_sites_uid = acitve_sites_table.active_sites_uid
AND acitve_sites_table.account_id = accounts_table.account_uid
AND wo_table.surface_code = wo_surface_code.wo_surface_code_id
AND wo_table.job_code = work_order_job_codes.wo_job_code_id
AND wo_status_codes = 1");
if (!$result4)
{
$error = 'Error fetching wo_table data!';
include ("error.html.php");
exit();
}
while($row=mysqli_fetch_array($result4))
{
$wo_tables[]=array('work_order_uids'=>$row['work_order_uids'],'account_name'=>$row['account_name']
,'work_order_job_code_desc'=>$row['work_order_job_code_desc'],'wo_surface_code_description'=>$row['wo_surface_code_description']);
};
//var_dump($wo_tables);
?>
<html>
<body>
<?php foreach($wo_tables as $wo_table):?>
<form>
<li>
<div>
<hi><?php htmlout($wo_table['account_name']);?></hi>
<hi><?php htmlout($wo_table['work_order_job_code_desc']);?></hi>
<hi><?php htmlout($wo_table['wo_surface_code_description']);?></hi>
<hi><?php htmlout($wo_table['work_order_uids']);?></hi>
</div>
</li>
</form>
</body>
</html>
<?php var_dump($wo_table); ?>
<?php endforeach;?>
|