2
I’m getting this mistake:
#1064 - You have an error in your SQL syntax;
I’ve tried so many ways, but there’s always this mistake.
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
another attempt 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 day before the event
using the curdate
.
My table EVENT
has the columns id
, name
, description
, date_at
, time_at
and category_id
. The table CATEGORY
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
What do you want ? Write the question so we know...
– Diego Souza
What you hope to get with
CURDATE()-1
?– Victor Stafusa