hello,
here comes a script which behaves differently with php 4.2.0 + mysql
3.23.49 and php 4.3.3 (or 4.2.3) + mysql 4.0.15.
the oldest version gives the "good" result (with a tiny problem : no
"Fatal error : Maximum execution time of 1 second exceeded in..."
appears... ) : the execution time of the script does not exceed 1 second.
the newest one does not care of the set_time_limit(1) function and the
script is normally executed.
--> why? how can I get the "good" result with php 4.3.3 + mysql 4.0.15?
thanks,
sylvain
please, try this script (do not forget to set host, user and password) :
<?php
set_time_limit(1);
$t_start = array_sum(explode(' ', microtime()));
$link = mysql_connect("localhost", "", "");
if ( !is_resource($link) ){ exit(mysql_error()); }
$query = "SELECT BENCHMARK(10000000, ENCODE('hello', 'world')) ;";
@mysql_query($query, $link);
if ( mysql_error() != "" ){ exit(mysql_error()); }
@mysql_close($link);
$exec_time = array_sum(explode(' ', microtime())) - $t_start;
echo "Execution time is $exec_time seconds.";
?>