I'm having trouble with this script and I would appreciate any here:
<? php
//ini_set('display_errors', '1');
//MQSQL connection
require_once('../../include/init.phph');
function transportQueue(){
//siteinfoDbCon();
siteinfoDbConNoLag();
$query = "SELECT
a.transport_id, a.site_id, b.site_name, c.name as 'From DC',
d.name as 'To DC', a.cutover, a.working, a.error
FROM transport_queue a
INNER JOIN sites b ON(a.site_id=b.site_id)
INNER JOIN datacenters c ON(a.from_dc_id=c.datacenter_id)
INNER JOIN datacenters d ON(a.to_dc_id=d.datacenter_id)
WHERE
a.cutover BETWEEN NOW() AND ADDDATE(NOW(), INTERVAL 7 day)
ORDER BY a.cutover";
//Pull results
$results=mysql_query($query);
//Return into an array $transports
while($row=mysql_fetch_array($results,MYSQL_BOTH)){
$transports[]=$row;
print_r($transports[0]["site_id"]);
}
//Free up the results
mysql_free_result($results);
//Close the db connection
siteinfoDbClose();
}
transportQueue();
?>
I can confirm that the query works and the DB connections work... I'm at a loss.
I'm trying to return the results into an associative array. I did review the following question/answer: Dump mysql_fetch_array results into a multidimensional array
Trying to
Any thoughts?