Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

117
Views
Cómo comparar la fecha de hoy con la fecha en la base de datos con php

Por favor, ayuda sobre cómo comparar una fecha con la fecha en la base de datos en php

algo como

 $today = date("ymd"); select * from table name where date <= $today

No está funcionando de esta manera.

Por favor ayuda

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Prueba esto

 SELECT * FROM table_name WHERE date <= CURDATE()

También puedes usar

 SELECT NOW(),CURDATE(),CURTIME()

resultará en algo como esto:

 NOW() --> 2014-11-22 12:45:34 CURDATE() --> 2014-11-22 CURTIME() --> 12:45:34

Para más información ingresa a este enlace

over 4 years ago · Santiago Trujillo Report

0

Agregar citas:

 $sql = "select * from table name where date <= '{$today}';

Y date de campo en la base de datos establecida como fecha y datetime

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!