Requete SQL affichage données
pxone
Messages postés
67
Date d'inscription
Statut
Membre
Dernière intervention
-
Melooo Messages postés 1405 Date d'inscription Statut Membre Dernière intervention -
Melooo Messages postés 1405 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
Je souhaiterai seulement afficher les enregistrements qui sont à la date du jour
$datejour = date("Y-m-d");?>
<?php $requete="SELECT * FROM reception ORDER BY date DESC LIMIT 0,10 WHERE date=$datejour";?>
Je souhaiterai seulement afficher les enregistrements qui sont à la date du jour
$datejour = date("Y-m-d");?>
<?php $requete="SELECT * FROM reception ORDER BY date DESC LIMIT 0,10 WHERE date=$datejour";?>
A voir également:
- Requete SQL affichage données
- Fuite données maif - Guide
- Affichage double ecran - Guide
- Supprimer les données de navigation - Guide
- Trier des données excel - Guide
- Windows 11 affichage classique - Guide
3 réponses
Mon tableau est vide voici les erreurs afficheés
Notice: Use of undefined constant act - assumed 'act' in C:\wamp\www\projet\arrivee\distri.php on line 9
Notice: Undefined index: act in C:\wamp\www\projet\arrivee\distri.php on line 9
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\projet\arrivee\distri.php on line 43
Notice: Use of undefined constant act - assumed 'act' in C:\wamp\www\projet\arrivee\distri.php on line 9
Notice: Undefined index: act in C:\wamp\www\projet\arrivee\distri.php on line 9
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\projet\arrivee\distri.php on line 43
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<?php include "fonctions/connection.inc.php"; ?>
<?php include "fonctions/fonction_date.php"; ?><title>Gestion Plis arrivee</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><style type="text/css">
</style></head><body>
<?php //----------------------------------Suppression---------------------
if ($_GET[act]=="supp")
{
$reqsuppression="DELETE FROM reception WHERE id=$_GET[id]";
mysql_query($reqsuppression,$id_conn); // Fonction d'éxecution de la requete
}
//----------------------------------fin Suppression---------------------
//--------D?claration de variables---------
$datejour = date("Y-m-d");
//--------D?claration de variables---------
?>
<?php $requete="SELECT * FROM reception ORDER BY date DESC LIMIT 0,10 WHERE date=date('Y-m-d')";
$resultat=mysql_query($requete);
?>
<table style="text-align: left; width: 987px; height: 145px;" border="1"
cellpadding="2" cellspacing="2">
<tbody>
<tr align="center">
<td colspan="10" rowspan="1"
style="vertical-align: top; background-color: rgb(204, 204, 204);"><big><big>REMISES CONTRADICTOIRES </big></big></td>
</tr>
<tr>
<td style="font-weight: bold;"><big><big>Date</big></big></td>
<td style="font-weight: bold;"><big>Quantité</big></td>
<td style="font-weight: bold;"><big>Transporteur</big></td>
<td style="font-weight: bold;"><big>N° de suivi</big></td>
<td style="font-weight: bold;"><big>Expediteur</big></td>
<td style="font-weight: bold;"><big>Code postal</big></td>
<td style="font-weight: bold;"><big>Pays</big></td>
<td style="font-weight: bold;"><big>Destinataire</big></td>
<td style="font-weight: bold;"><big>Service</big></td>
<td style="font-weight: bold;"><big>Signature</big></td>
</tr>
<?php while($reception=mysql_fetch_array($resultat)) { ?>
<?php $ordre=fr_mysql;//Variable pour conversion de date US vers FR
$date=convertir_date($reception['date'],$ordre) //Fonction pour conversion de date US vers FR
?>
<tr>
<td style="height: 57px;"><big><big><?php echo $date ; ?></big></big></td>
<td style="height: 57px;"><big><big><?php echo $reception['nombre'] ?></big></big></td>
<td style="height: 57px;"><big><big><?php echo $reception['transporteur'] ?></big></big></td>
<td style="height: 57px;"><big><big><?php echo $reception['suivi'] ?></big></big></td>
<td style="height: 57px;"><big><big><?php echo $reception['expediteur'] ?></big></big></td>
<td style="height: 57px;"><big><big><?php echo $reception['codepostal'] ?></big></big></td>
<td style="height: 57px;"><big><big><?php echo $reception['pays'] ?></big></big></td>
<td style="height: 57px;"><big><big><?php echo $reception['destinataire'] ?></big></big></td>
<td style="height: 57px;"><big><big><?php echo $reception['service'] ?></big></big></td>
<td style="height: 57px;"><big><big>:</big></big></td>
</tr>
<?php } ?>
</tbody></table>
<?php echo"<div align=\"center\"><a href=\"javascript:window.print()\">Imprimer cette page</a>"; ?>
</body></html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<?php include "fonctions/connection.inc.php"; ?>
<?php include "fonctions/fonction_date.php"; ?><title>Gestion Plis arrivee</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><style type="text/css">
</style></head><body>
<?php //----------------------------------Suppression---------------------
if ($_GET[act]=="supp")
{
$reqsuppression="DELETE FROM reception WHERE id=$_GET[id]";
mysql_query($reqsuppression,$id_conn); // Fonction d'éxecution de la requete
}
//----------------------------------fin Suppression---------------------
//--------D?claration de variables---------
$datejour = date("Y-m-d");
//--------D?claration de variables---------
?>
<?php $requete="SELECT * FROM reception ORDER BY date DESC LIMIT 0,10 WHERE date=date('Y-m-d')";
$resultat=mysql_query($requete);
?>
<table style="text-align: left; width: 987px; height: 145px;" border="1"
cellpadding="2" cellspacing="2">
<tbody>
<tr align="center">
<td colspan="10" rowspan="1"
style="vertical-align: top; background-color: rgb(204, 204, 204);"><big><big>REMISES CONTRADICTOIRES </big></big></td>
</tr>
<tr>
<td style="font-weight: bold;"><big><big>Date</big></big></td>
<td style="font-weight: bold;"><big>Quantité</big></td>
<td style="font-weight: bold;"><big>Transporteur</big></td>
<td style="font-weight: bold;"><big>N° de suivi</big></td>
<td style="font-weight: bold;"><big>Expediteur</big></td>
<td style="font-weight: bold;"><big>Code postal</big></td>
<td style="font-weight: bold;"><big>Pays</big></td>
<td style="font-weight: bold;"><big>Destinataire</big></td>
<td style="font-weight: bold;"><big>Service</big></td>
<td style="font-weight: bold;"><big>Signature</big></td>
</tr>
<?php while($reception=mysql_fetch_array($resultat)) { ?>
<?php $ordre=fr_mysql;//Variable pour conversion de date US vers FR
$date=convertir_date($reception['date'],$ordre) //Fonction pour conversion de date US vers FR
?>
<tr>
<td style="height: 57px;"><big><big><?php echo $date ; ?></big></big></td>
<td style="height: 57px;"><big><big><?php echo $reception['nombre'] ?></big></big></td>
<td style="height: 57px;"><big><big><?php echo $reception['transporteur'] ?></big></big></td>
<td style="height: 57px;"><big><big><?php echo $reception['suivi'] ?></big></big></td>
<td style="height: 57px;"><big><big><?php echo $reception['expediteur'] ?></big></big></td>
<td style="height: 57px;"><big><big><?php echo $reception['codepostal'] ?></big></big></td>
<td style="height: 57px;"><big><big><?php echo $reception['pays'] ?></big></big></td>
<td style="height: 57px;"><big><big><?php echo $reception['destinataire'] ?></big></big></td>
<td style="height: 57px;"><big><big><?php echo $reception['service'] ?></big></big></td>
<td style="height: 57px;"><big><big>:</big></big></td>
</tr>
<?php } ?>
</tbody></table>
<?php echo"<div align=\"center\"><a href=\"javascript:window.print()\">Imprimer cette page</a>"; ?>
</body></html>
Disons que dans mon tableau je voudrais afficher que les enregistrement du jour
donc je declare une variable $datejour et je la compare a la date enregistré dans ma base de donnees
Merci de ton aide !
donc je declare une variable $datejour et je la compare a la date enregistré dans ma base de donnees
Merci de ton aide !