I compare email addresses in PHP from MySQL database:
$query
->select(array('a.dtstart','a.cal_id','b.name','a.email'))
->from('#__pbbooking_events AS a')
->join('INNER', '#__pbbooking_cals AS b ON (a.cal_id = b.id)')
->where('a.email = ' . $user->email)
->where(' a.dtstart>'. $query->currentTimestamp())
->order('a.dtstart ASC');
$user
just has information of the currently logged user.
I get this error
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
@RET.RU AND A.DTSTART>CURRENT_TIMESTAMP() ORDER BY A.DTSTART ASC
AT LINE 4
If I remove the where
clause that compares emails, then the query runs without error.
I have read somewhere that the problem is the @
sign but how can I make this comparison then?