Ok.. heres the problem.. i finally got the output to exactly how i want it.. and i run into a time problem..
Fatal error: Maximum execution time of 30 seconds exceeded in f:\websites\bahrainlocator\test\records.php on line 39
so i went into the php.ini file and changed the max_execution_time to 300 to make sure i get it.
The script actually went further (from 421 to 642).. but stops again with another message:
Warning: Invoke() failed: Exception occurred. in f:\websites\bahrainlocator\test\records.php on line 39
Fatal error: NULL pointer exception in f:\websites\bahrainlocator\test\records.php on line 39
I even took the max_execution_time all the way to 6000, but still got the same result.
Now im lost. i can't figure it out and i got a deadline coming up... if anyone can provide an answer i would be forever grateful.
PS. For any who are intrested, here is my entire script:
<?php
// Start storing the content in a buffer
ob_start();
?>
<h2 align="Center">Road Indexing</h2>
<table border="1" cellpadding="1" cellspacing="1">
<?php
// open up a connection to the database
$DB_Conn = new COM("ADODB.Connection") or die("Cannot start ADO");
$DB_Conn->Open("Indexing");
//$DB_Conn->conn.connectiontimeout = 300;
// run block query
$DQ_Blocks = $DB_Conn->Execute("SELECT * FROM blocks ORDER BY Block ASC");
// iterate through the recordset
while (!$DQ_Blocks->EOF) {
$blockfilter = $DQ_Blocks->Fields('Block');
echo "
<tr>
<th colspan=5 align=left><B>BLOCK <font color=#FF0000>$blockfilter->value</font> - <font color=#FF0000>AREA NAME</font></B></th>
</tr>
<tr>
<th align=left>Road No</th>
<th align=left>Start Page</th>
<th align=left>Start Grid</th>
<th align=left>End Page</th>
<th align=left>End Grid</th>
</tr>
";
// execute a query
$DQ_Roads = $DB_Conn->Execute("SELECT * FROM roads WHERE Block = $blockfilter->value ORDER BY Road ASC");
// iterate through the recordset
while (!$DQ_Roads->EOF)
{
// get the field data into variables
$road_no = $DQ_Roads->Fields('Road');
$start_page = $DQ_Roads->Fields('Start Page');
$start_grid = $DQ_Roads->Fields('Start Grid');
$end_page = $DQ_Roads->Fields('End Page');
$end_grid = $DQ_Roads->Fields('End Grid');
echo "
<tr>
<td align=left>$road_no->value</td>
<td align=center>$start_page->value</td>
<td align=left>$start_grid->value</td>
";
if (!"$end_page->value") {
echo "
<td align=center>$start_page->value</td>
";
} else {
echo "
<td align=center>$end_page->value</td>
";
}
if (!"$end_grid->value") {
echo "
<td align=center>$start_grid->value</td>
";
} else {
echo "
<td align=center>$end_grid->value</td>
";
}
echo "
</tr>
";
// go to the next record
$DQ_Roads->MoveNext();
}
// go to the next record
$DQ_Blocks->MoveNext();
}
// Close table
echo "
</table>
";
// clean up
$DQ_Blocks->Close();
$DQ_Roads->Close();
$DB_Conn->Close();
$DQ_Blocks = null;
$DQ_Roads = null;
$DB_Conn = null;
// display buffer contents
ob_end_flush();
?>
(the error line points to the second database query)