Should look something like this:
function watchdog($type, $message, $severity = WATCHDOG_NOTICE, $link = NULL){
global $user;
$wid = db_next_id("watchdog");

db_query("INSERT INTO {watchdog} (wid, uid, type, message, severity, link, loc
ation, referer, hostname, timestamp) VALUES (%d, %d, '%s', '%s', %d, '%s', '%s',
'%s', '%s', %d)", $wid, $user->uid, $type, $message, $severity, $link, request_
uri(), referer_uri(), $_SERVER['REMOTE_ADDR'], time());

}

Comments

hunmonk’s picture

Status: Active » Closed (works as designed)

this is by design for performance reasons.

howertko’s picture

Makes it difficult to port this code to other databases that don't support auto incrementing columns (ie Ingres).