This repository has been archived on 2025-05-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
qemudb/include/appdb.php
Chris Morgan 6119246b51 Replace direct mysql_xxx() calls with query_xxx() calls. Replace calls to mysql_insert_id()
with calls specific to the appdb or bugzilla database. Fixes a bug where a call to
mysql_insert_id() can potentially retrieve an id from either the bugzilla or appdb database,
depending on whichever database was last opened by mysql_connect().
2007-08-03 23:27:25 +00:00

42 lines
1.4 KiB
PHP

<?php
function log_category_visit($catId)
{
global $REMOTE_ADDR;
$result = query_parameters("SELECT * FROM catHitStats WHERE ip = '?' AND catId = '?'",
$REMOTE_ADDR, $catId);
if($result && query_num_rows($result) == 1)
{
$oStatsRow = query_fetch_object($result);
query_parameters("UPDATE catHitStats SET count = count + 1 WHERE catHitId = '?'",
$oStatsRow->catHitId);
} else
{
query_parameters("INSERT INTO catHitStats (appHitId, time, ip, catId, count) ".
"VALUES (?, ?, '?', '?', '?')",
"null", "null", $REMOTE_ADDR, $catId, "1");
}
}
function log_application_visit($appId)
{
global $REMOTE_ADDR;
$result = query_parameters("SELECT * FROM appHitStats WHERE ip = '?' AND appId = '?'",
$REMOTE_ADDR, $appId);
if($result && query_num_rows($result) == 1)
{
$stats = query_fetch_object($result);
query_parameters("UPDATE appHitStats SET count = count + 1 WHERE appHitId = '?'",
$stats->appHitId);
} else
{
query_parameters("INSERT INTO appHitStats (appHitId, time, ip, appId, count) ".
"VALUES (?, ?, '?', '?', '?')",
"null", "null", $REMOTE_ADDR, $appId, "1");
}
}
?>