I would like to know whether this MySql statement will be executed correctly,
"SELECT sum(price) FROM products WHERE productid IN (SELECT productid FROM shoppingcart WHERE sessionid=".$this->$sessionid.")"
And if not please give me pointers as to where I am wrong.
Thanks
I’m sure you meant
not
(the second one returns value of property, which name is stored in sessionid, thus, when $sessionid is ‘abcdef’, it tries to return value of $this->abcdef property).
Also, enclose in ‘ AND escape all parameters.