So I have two tables like given below:
- tb_custmap: idCust, idUser
- tb_cust: idCust, revenue
I want to get the revenue from tb_cust based on the idCust and only from specific idUser. I've tried this:
SELECT tb_cust.revenue
FROM tb_custmap INNER JOIN
tb_cust
ON tb_custmap.idCust = tb_cust.idCust
ORDER BY tb_cust.revenue
WHERE idUser='".$AccMgrID."'
But I got error and it is said
"You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE idUser='azkyath'' at line 1 "
Please someone help me ive been doing this for 2 days and still can't get the right one.