Hello i am trying to do combine UPDATE and SELECT statement in one query.
This is the one i tried. but didnt work.
$this->$db2->query('
UPDATE users
SET total = (total - (
SELECT floatingnumber
FROM posts
WHERE post_id = "'.$this->post_id.'"
LIMIT 1
))
WHERE id = "'.$this->post_user->id.'"
LIMIT 1
');
try this one with
INNER JOIN, withoutSELECT