I am building an analytics dashboard for my work. The user selects metrics on the front end that builds a query in Eloquent, that is then executed and results are spit out in an HTML table back on the front end.
This is the query in question, generated by Eloquent (where clauses changed for client privacy, we do not actually work with Google lol):
SELECT DISTINCT Week(display.date) AS date_granularity,
`display`.`site`,
`display`.`ad_unit`,
Sum(display.revenue)
FROM `display`
INNER JOIN `traffic`
ON `traffic`.`date` = `display`.`date`
WHERE `display`.`date` BETWEEN '2022-05-29' AND '2022-06-14'
AND ( `display`.`site` = 'Google' )
AND ( `display`.`ad_unit` = 'ABC' )
GROUP BY `date_granularity`,
`display`.`site`,
`display`.`ad_unit`
When I execute this query in MySQL workbench, I get nothing, indicating that the ABC ad unit does not run on Google's sites. If I change the site to a client of ours that does run the ABC ad unit, I get results.
The problem is, when I run this query using my app from the front end, I get results, where I assume I should not because the ABC ad unit does not run on Google's sites, according to MySQL Workbench.
Any idea why Eloquent might be returning different results? My gut tells me MySQL workbench is correct, because when I do
SELECT * FROM table WHERE site = 'Google'
and manually scroll through the results grid, I found no examples of the ABC ad unit on Google. I have also confirmed that both are connected to the same database.