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

153
Views
Me gustaría agregar un cuadro de búsqueda por fecha a mi tabla usando mysql php

Tengo una tabla asociada a una base de datos mysql, lo único que quiero es agregar un cuadro de búsqueda por fecha.

Aunque he probado muchos métodos, pero desafortunadamente todos no me funcionaron como debería. Este es mi código:

 <form action="" method="GET""> <input type="date" name="search" class="form-control" placeholder="Start" > <button type="submit" class="btn btn-primary">Search</button> </form>
 function getRecords($params) { $rp = isset($params['rowCount']) ? $params['rowCount'] : 10; if (isset($params['current'])) { $page = $params['current']; } else { $page = 1; } $start_from = ($page - 1) * $rp; $sql = $sqlRec = $sqlTot = $where = ''; if (!empty($params['searchPhrase'])) { $where .= " WHERE "; $where .= " ( fullname LIKE '" . $params['searchPhrase'] . "%' "; $where .= " OR email LIKE '" . $params['searchPhrase'] . "%' "; $where .= " OR phone LIKE '" . $params['searchPhrase'] . "%' )"; } if (!empty($params['sort'])) { $where .= " ORDER By " . key($params['sort']) . ' ' . current($params['sort']) . " "; } // getting total number records without any search $sql = "SELECT * FROM `api` where DATE_FORMAT(created_at, '%Y-%m-%d') = DATE_SUB(CURRENT_DATE(),INTERVAL 1 DAY)"; $sqlTot .= $sql; $sqlRec .= $sql; //concatenate search sql if value exist if (isset($where) && $where != '') { $sqlTot .= $where; $sqlRec .= $where; } if ($rp != -1) $sqlRec .= " LIMIT " . $start_from . "," . $rp; }
about 4 years ago · Juan Pablo Isaza
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!