Hi,
I wrote a php script that connects to a Access2k database through ODBC. I made a system DSN and used it in my script. This works fine, but when i run a query, it takes at least 5 minutes to execute. I don't think this is normal. This is my script:
// no timeout
set_time_limit(0);
// make connection with database
require("connect.inc.php");
// make query
$query = "SELECT * FROM Tijdsbestedingen";
// execute query
$result = odbc_exec( $connection, $query );
if( !$result )
{
print( "The query: <i>$sql</i> failed miserably!" );
exit;
}
// generate table
// counter
$count = 0;
// fetch rows
while( odbc_fetch_row( $result ) )
{
$count++;
print( "<tr>" );
for( $j = 1; $j < odbc_num_fields( $result ); $j++ )
{
// print row
print( "<td>" . odbc_result( $result, $j ) . "</td>" );
}
// print remarks
print( "</tr><tr><td> </td><td colspan=\"5\">" . odbc_result( $result, $j ) . "</td></tr>" );
}
print( "</table>" );
// free resources
odbc_free_result( $result );
odbc_close( $connection );
print( "Number of records: $count\t" );
// benchmarking
$timeEnd = time();
print("Begin time: " . date( "G:i:s", $timeBegin ) . "\n End time: " . date( "G:i:s", $timeEnd ) . "\n Total execution time: " . ( $timeEnd - $timeBegin ) . " seconds" );
The query I use is a simple SELECT * FROM TABLE. What is going wrong?? Does anyone know... it's so slow...
thanx...