Nasao sam ne netu ovu f-ju,samo sto mi mrsko sad da menjam pola koda na sajtu samo zbog toga,da nema neki laski nacin?
evo code,mozda nekome zatreba.
Code:
function db_query($sql) {
// Declare as static variable before declare global
static $total_mysql_queries;
// Declare as global variable
global $total_mysql_queries;
if(mysql_query($sql)) { // Query successfully executed?
// Add +1 to variable $total_mysql_queries
++$total_mysql_queries;
// Return true, the query was successfully executed
return true;
}
// I'm sure there was a mysql error...
return false;
}
.
.
.
db_query('SELECT `user` FROM `users` WHERE `id` = 1 ORDER BY `id` LIMIT 1;') or die(mysql_error());
.
.
.
echo 'A total of ', isset($total_mysql_queries) ? $total_mysql_queries : 0, ' MySQL queries were executed.';
SERVIA NOSTRUM REGNUM!