Query Working Fine MS SQL but Giving Error in PHP

149
December 16, 2018, at 12:40 PM
select count(ratings) as number_of_ratings,sum(ratings) as sum_of_ratings 
from performance_reviews 
where year(review_date)=2004 and employee_id='00009-1761417-9';

i am executing above QUERY in php it is giving error

incorrect syntax near '2004'

i also tried it with

select count(ratings) as number_of_ratings,sum(ratings) as sum_of_ratings 
from performance_reviews 
where year(review_date)='2004' and employee_id='00009-1761417-9';

my php query as

$query = "select count(ratings) as number_of_ratings,sum(ratings) as sum_of_ratings 
          from performance_reviews 
          where year(review_date)='$year' and employee_id='$emp_id'";

Whats Error in it

Rent Charter Buses Company
READ ALSO
PHP MySQL “id” Conflict and Uncaught PDOException

PHP MySQL “id” Conflict and Uncaught PDOException

Firstly, I'm experiencing ID conflictIn the database, I have a table called "admin" with row called "id"

136
Check the referrals, add the referrals to the balance and remove the referrals in php?

Check the referrals, add the referrals to the balance and remove the referrals in php?

I am trying to make this workThe script has to check the users from the users table one by one

103
Gitlab CI dusk - MySQL connection refused

Gitlab CI dusk - MySQL connection refused

This was asked several times now but I tried every solution, I found and have a running "normal" PHPUnit test with a similar setting, so not everything I do can be wrong

170