I'm getting this error:
# 1064 - You have an error in your SQL syntax;
I have tried it in many ways, but it always gives this error.
Here are two of my attempts:
SELECT 'category'. * , 'event'. *
FROM category, event
WHERE 'category_id' = 7,
WHERE date_at = CURDATE()-1
ORDER BY 'event'.'category_id' ASC
LIMIT 0 , 30
SELECT 'category'. * , 'event'. *
FROM category, event
WHERE 'category_id' = 7 as date_at = CURDATE()-1
ORDER BY 'event'.'category_id' ASC
LIMIT 0 , 30
try again after some response worked and returns 0
SELECT 'event'. * , 'category'. *
FROM event, category
WHERE date( date_at ) = CURDATE( ) -1
AND category_id =7
LIMIT 0 , 30
I need to return the previous day of event
using curdate
.
My table EVENT
has the columns id
, name
, description
, date_at
, time_at
and category_id
. The CATEGORY
table has the columns id
, name
, color
, description
.
query = pegar os nomes ok
pegar as datas ok
pegar as categorias ok
pegar as categorias por id = ok
quando insiro CURDATE()-1 = You have an error in your SQL syntax;
pegar a data por curdate -1 ERRO