- $sql = '';
- $result_user = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE userid=%s AND cat_id=%s LIMIT 1",
- array($UID, bigintval($cat)), __FILE__, __LINE__);
-
- if (SQL_NUMROWS($result_user) == 0) {
- $sql = "INSERT INTO `{!_MYSQL_PREFIX!}_user_cats` (userid, cat_id) VALUES ('%s','%s')";
- } else {
- // Free memory
- SQL_FREERESULT($result_user);
- }
+ $result_user = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `userid`=%s AND `cat_id`=%s LIMIT 1",
+ array(getMemberId(), bigintval($cat)), __FILE__, __LINE__);
+
+ if (SQL_NUMROWS($result_user) == '0') {
+ $sql = "INSERT INTO `{?_MYSQL_PREFIX?}_user_cats` (userid, cat_id) VALUES ('%s','%s')";
+ } // END - if
+
+ // Free memory
+ SQL_FREERESULT($result_user);