Thanks. That solved the problem.
So, if i want to insert data into the database using that same variable, is this the right way to also do it within the function
$query = "INSERT INTO TableName
(item_id,...,....,)
VALUES ($this->varName,...,...,)";
and is there a difference if i enclose it with apostrophe marks
('$this->varName',...,...,)";
and when i just leave it like this
($this->varName,...,...,)";
as someone said that these marks ' '
tell php to output it as it is, i wasn't sure if that makes any difference for a variable while being input into a database as when i tested, they both seemed to output the variable value