Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL Double Equal Sign

Tags:

sql

php

mysql

I'm debugging an old website, and I get some SQL errors. When I went through it, I found the following query.

UPDATE boats
set    new_high_date == DATE_ADD(NOW(), INTERVAL 3 MONTH)
WHERE  id=49701

I don't know what the == here means. Is this a valid query? I cannot seem to execute it.

I'm not sure if I should change this, or does it mean something?

like image 956
5hahiL Avatar asked Nov 27 '22 14:11

5hahiL


2 Answers

There is no double equal in MySQL so you should remove it.

like image 155
Louis Huppenbauer Avatar answered Dec 10 '22 02:12

Louis Huppenbauer


That is incorrect, there is no double equal sign in sql. The correct way to set is

UPDATE boats 
SET    new_high_date = DATE_ADD(NOW(), INTERVAL 3 MONTH)
WHERE  id = 49701
like image 31
John Woo Avatar answered Dec 10 '22 03:12

John Woo