⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Show results for filter table,Mostrar Resultados de una tabla por filtro



beimar24
  • profile picture
  • Member

Posted 29 August 2013 - 04:17 AM

Very good day appreciated Engineers
I have this
$ crud-> where ('date> =',2013-08-28 ');
$ crud-> set_table ('events')
and it works perfect
 
Now I want to do this
$ crud-> where ('date =', 'CURDATE () -2');
But he says there are no records to show
and effectively if attempt records
Anyone have Any Idea what is happening??
 
in advance thank you very much for your attention
cordially
Beimar trujillo

_______________________________________________________________

Muy buen dia apreciados Ingenieros 
Tengo esto
$crud->where('fecha >=',2013-08-28');
$crud->set_table('eventos')
y me funciona perfecto 
 
Ahora quiero hacer esto   
$crud->where('fecha = ','CURDATE()-2');  
Pero me dice que no hay registros para mostrar 
y efectivamente si tento registros
Alguien tiene Alguna Idea que puede estar pasando??
 
de antemano muchas gracias por su atencion 
Cordialmente 
Beimar trujillo 

 

 

 

 


davidoster
  • profile picture
  • Member

Posted 29 August 2013 - 07:08 AM

Hello [member=beimar24].

I would suggest you replace the MySQL part of CURDATE() - 2 with the PHP equivalnet and you pass this value straight to your query.

E.g. 

$curdate = date('Y-m-d',strtotime('-2 days'));
$crud->where('date =', $curdate);

beimar24
  • profile picture
  • Member

Posted 29 August 2013 - 13:44 PM

Dear Engineer thank you very much for your collaboration
I worked perfectly
Thank you very much for your collaboration
from Bogota Colombia
a greeting

___________________________________________________________

 

Apreciado Ingeniero muchas gracias por tu colaboracion 
me ha funcionado de maravilla 
Muchas gracias por tu colaboracion 
desde Bogota colombia 
un saludo