Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created November 7, 2019 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/d2df6d15bd8e90f8affbf9740ff44549 to your computer and use it in GitHub Desktop.
Save parzibyte/d2df6d15bd8e90f8affbf9740ff44549 to your computer and use it in GitHub Desktop.
<?php
include_once "base_de_datos.php";
$fecha = date("Y-m-d") . " 00:00:00";
$diaSiguienteMedianoche = date("Y-m-d", strtotime("+1 day", strtotime($fecha))) . " 00:00:00";
$consulta = "select * from ventas where fecha >= ? and fecha < ?";
$sentencia = $base_de_datos->prepare($consulta);
$sentencia->execute([$fecha, $diaSiguienteMedianoche]);
$ventas = $sentencia->fetchAll(PDO::FETCH_OBJ);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment