set_time_limit + mysql

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • -----> sylvain

    set_time_limit + mysql

    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(explo de(' ', microtime()));

    $link = mysql_connect(" localhost", "", "");
    if ( !is_resource($l ink) ){ exit(mysql_erro r()); }

    $query = "SELECT BENCHMARK(10000 000, ENCODE('hello', 'world')) ;";
    @mysql_query($q uery, $link);
    if ( mysql_error() != "" ){ exit(mysql_erro r()); }

    @mysql_close($l ink);

    $exec_time = array_sum(explo de(' ', microtime())) - $t_start;
    echo "Execution time is $exec_time seconds.";

    ?>

Working...