Hi,
Im fixing up an automatic referral system but am stuck on one thing which ive been trying to fix for days now.
So the code is:
if(!empty($_SESSION['refer'])){
$execute = $db->query("UPDATE users SET refer_count = refer_count + '1' WHERE username = '".$this->filtertext($_SESSION['refer'])."' LIMIT 1");
}
header("LOCATION: ". PATH ."/me.php");
return true;
The bit I highlighted in red is the problem, I forced PHP to display errors and the following errors displayed:
Notice: Undefined variable: db in C:\xampp\htdocs\inc\functions.php on line 438
Fatal error: Call to a member function query() on null in C:\xampp\htdocs\inc\functions.php on line 438
If you can help me fix this error I would greatly appreciate it, Thank You!!!!
- - - Updated - - -
Someone please help me ASAP!!!!




THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU,

