Hi guys,
I have a CMS system which I've spent the last week fixing. It's built in PHP, and now I'm stuck on the most simplest of tasks. I can't figure out why I am receiving an "undefined variable" error within this block of code. Any help would be greatly appreciated.
function track_app($app_id, $lang_code, $str, $instance) {
$lang_id = get_lang_id($lang_code);
if ($instance > 0) {
if ($str == 'LOAD_APP' || $str == 'APP_LOADED') {
$query = "INSERT INTO `tracking` (
`APPLICATION_ID`, `LANG_ID`, `INFO`, INSTANCE_ID
) VALUES (
$app_id, $lang_id, '$str', $instance
)";
}
mysql_query("INSERT INTO `tracking_backup` (
`APPLICATION_ID`, `LANG_ID`, `INFO`, INSTANCE_ID
) VALUES (
$app_id, $lang_id, '$str', $instance
)");
mysql_query("UPDATE `instances` SET ACTIVE = 1 WHERE INSTANCE_ID = $instance");
} else {
$query = "INSERT INTO `tracking` (
`APPLICATION_ID`, `LANG_ID`, `INFO`
) VALUES (
$app_id, $lang_id, '$str'
)";
}
mysql_query($query);
}