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().
This commit is contained in:
@@ -6,9 +6,9 @@ function log_category_visit($catId)
|
||||
|
||||
$result = query_parameters("SELECT * FROM catHitStats WHERE ip = '?' AND catId = '?'",
|
||||
$REMOTE_ADDR, $catId);
|
||||
if($result && mysql_num_rows($result) == 1)
|
||||
if($result && query_num_rows($result) == 1)
|
||||
{
|
||||
$oStatsRow = mysql_fetch_object($result);
|
||||
$oStatsRow = query_fetch_object($result);
|
||||
query_parameters("UPDATE catHitStats SET count = count + 1 WHERE catHitId = '?'",
|
||||
$oStatsRow->catHitId);
|
||||
} else
|
||||
@@ -25,9 +25,9 @@ function log_application_visit($appId)
|
||||
|
||||
$result = query_parameters("SELECT * FROM appHitStats WHERE ip = '?' AND appId = '?'",
|
||||
$REMOTE_ADDR, $appId);
|
||||
if($result && mysql_num_rows($result) == 1)
|
||||
if($result && query_num_rows($result) == 1)
|
||||
{
|
||||
$stats = mysql_fetch_object($result);
|
||||
$stats = query_fetch_object($result);
|
||||
query_parameters("UPDATE appHitStats SET count = count + 1 WHERE appHitId = '?'",
|
||||
$stats->appHitId);
|
||||
} else
|
||||
|
||||
Reference in New Issue
Block a user