Jump to content
New Reality: Ads For Members ×

Complex query help


gmc1103

Recommended Posts

Hi

 

I would like some help with this query, the purpose is when someone make an activity , after the date he must define if that activity has been done or not, and i want to put an alert until those fields are registered into the database

The query is this one

SELECT COUNT( * ) AS total
FROM  `nem_pae_atividades` 
WHERE  `idutilizador` =1355
AND  `data` >= CURDATE( ) 
AND  `realizado` IS NULL 
OR LENGTH(  `realizado` ) =0

But i have  always 1 because of the last "and", how can i fix this??

Link to comment
https://forums.phpfreaks.com/topic/298483-complex-query-help/
Share on other sites

Hi Barand

 

Thank you, iv'e tried the way you told me with no success

 

This is what i have in my db

 

plano.png

 

So my point is the make the owner change the field "realizado" if the "data" has been reached

 

My last query was

SELECT COUNT( * ) AS total
FROM  `nem_pae_atividades` 
WHERE (
 `idutilizador` =1355
AND  `data` >= CURDATE( )
)
OR (
 `realizado` IS NULL 
OR LENGTH(  `realizado` )
) =0
Link to comment
https://forums.phpfreaks.com/topic/298483-complex-query-help/#findComment-1522681
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.