Changeset 587 for trunk/include/functions.inc.php
- Timestamp:
- Oct 30, 2004, 5:42:29 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions.inc.php
r579 r587 52 52 // retrieving the properties of the table. Each line represents a field : 53 53 // columns are 'Field', 'Type' 54 $result= mysql_query("desc $table");54 $result=pwg_query("desc $table"); 55 55 while ( $row = mysql_fetch_array( $result ) ) 56 56 { … … 351 351 $query.= ",'".$_SERVER['REMOTE_ADDR']."'"; 352 352 $query.= ",'".$file."','".$category."','".$picture."');"; 353 mysql_query( $query );353 pwg_query( $query ); 354 354 } 355 355 } … … 409 409 $query.= ' AND mail_address IS NOT NULL'; 410 410 $query.= ';'; 411 $result = mysql_query( $query );411 $result = pwg_query( $query ); 412 412 while ( $row = mysql_fetch_array( $result ) ) 413 413 { … … 445 445 } 446 446 447 function pwg_query( $query ) 448 { 449 global $count_queries,$queries_time; 450 447 function pwg_query($query) 448 { 451 449 $start = get_moment(); 452 $output = ''; 453 454 $count_queries++; 455 $output.= '<br /><br />['.$count_queries.'] '.$query; 456 $result = mysql_query( $query ); 457 $time = get_moment() - $start; 458 $queries_time+= $time; 459 $output.= '<b>('.number_format( $time, 3, '.', ' ').' s)</b>'; 460 $output.= '('.number_format( $queries_time, 3, '.', ' ').' s)'; 461 462 // echo $output; 450 $result = mysql_query($query); 451 452 if (DEBUG) 453 { 454 global $count_queries,$queries_time; 455 456 $time = get_moment() - $start; 457 $count_queries++; 458 459 $output = ''; 460 $output.= '<pre>['.$count_queries.'] '."\n".$query; 461 $queries_time+= $time; 462 $output.= "\n".'(this query time : '.number_format( $time, 3, '.', ' ').' s)</b>'; 463 $output.= "\n".'(total SQL time : '.number_format( $queries_time, 3, '.', ' ').' s)'; 464 $output.= '</pre>'; 465 echo $output; 466 } 463 467 464 468 return $result;
Note: See TracChangeset
for help on using the changeset viewer.