Requete SQL affichage données
Fermé
pxone
Messages postés
67
Date d'inscription
samedi 6 mars 2010
Statut
Membre
Dernière intervention
29 décembre 2012
-
22 févr. 2011 à 08:38
Melooo Messages postés 1405 Date d'inscription vendredi 28 novembre 2008 Statut Membre Dernière intervention 18 mars 2013 - 23 févr. 2011 à 11:15
Melooo Messages postés 1405 Date d'inscription vendredi 28 novembre 2008 Statut Membre Dernière intervention 18 mars 2013 - 23 févr. 2011 à 11:15
A voir également:
- Requete SQL affichage données
- Blob sql ✓ - Forum Webmastering
- Requete http - Guide
- Requete sql commence par ✓ - Forum Webmastering
- Requete sql sans doublon - Astuces et Solutions
- Requête sql doublons sur 2 champs ✓ - Forum Programmation
3 réponses
.Zoro.
Messages postés
263
Date d'inscription
mardi 17 août 2010
Statut
Membre
Dernière intervention
8 mai 2020
33
22 févr. 2011 à 09:04
22 févr. 2011 à 09:04
il faudrai que tu precise
ton probleme et ta question
c'est plus facile pour aider
ton probleme et ta question
c'est plus facile pour aider
pxone
Messages postés
67
Date d'inscription
samedi 6 mars 2010
Statut
Membre
Dernière intervention
29 décembre 2012
23 févr. 2011 à 10:14
23 févr. 2011 à 10:14
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
Melooo
Messages postés
1405
Date d'inscription
vendredi 28 novembre 2008
Statut
Membre
Dernière intervention
18 mars 2013
84
23 févr. 2011 à 10:15
23 févr. 2011 à 10:15
Donne nous le code
pxone
Messages postés
67
Date d'inscription
samedi 6 mars 2010
Statut
Membre
Dernière intervention
29 décembre 2012
23 févr. 2011 à 10:50
23 févr. 2011 à 10:50
<!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>
Melooo
Messages postés
1405
Date d'inscription
vendredi 28 novembre 2008
Statut
Membre
Dernière intervention
18 mars 2013
84
23 févr. 2011 à 10:54
23 févr. 2011 à 10:54
<?php include "fonctions/connection.inc.php"; ?> <?php include "fonctions/fonction_date.php"; ?>
Je ferais plutôt comme ca :
<?php
include ('fonctions/connection.inc.php");
include ('fonctions/fonction_date.php");
?>
Ton $_GET['act'] vient d'ou ?
pxone
Messages postés
67
Date d'inscription
samedi 6 mars 2010
Statut
Membre
Dernière intervention
29 décembre 2012
23 févr. 2011 à 11:10
23 févr. 2011 à 11:10
d'une autre page pour la suppression des enregistrement cela marche tres bien
Melooo
Messages postés
1405
Date d'inscription
vendredi 28 novembre 2008
Statut
Membre
Dernière intervention
18 mars 2013
84
23 févr. 2011 à 11:12
23 févr. 2011 à 11:12
Apparement pas tant que sa, car ca provoque une erreur
pxone
Messages postés
67
Date d'inscription
samedi 6 mars 2010
Statut
Membre
Dernière intervention
29 décembre 2012
22 févr. 2011 à 09:31
22 févr. 2011 à 09:31
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 !
Melooo
Messages postés
1405
Date d'inscription
vendredi 28 novembre 2008
Statut
Membre
Dernière intervention
18 mars 2013
84
22 févr. 2011 à 10:25
22 févr. 2011 à 10:25
Bonjour,
Tu as une erreur ?
Si oui, laquelle ?
Sinon il me semble que la clause LIMIT se met après le where ;)
Tu as une erreur ?
Si oui, laquelle ?
Sinon il me semble que la clause LIMIT se met après le where ;)
pxone
Messages postés
67
Date d'inscription
samedi 6 mars 2010
Statut
Membre
Dernière intervention
29 décembre 2012
22 févr. 2011 à 10:28
22 févr. 2011 à 10:28
Sinon a par le LIMIT tu penses que ma syntaxe est bonne je peux pas encore tester je suis au travail :-(
Melooo
Messages postés
1405
Date d'inscription
vendredi 28 novembre 2008
Statut
Membre
Dernière intervention
18 mars 2013
84
22 févr. 2011 à 10:37
22 févr. 2011 à 10:37
oui je pense que ta syntaxe est bonne ;)
tu peux même "bazarder" ta variable $datejour et faire ta requête comme ca :
tu peux même "bazarder" ta variable $datejour et faire ta requête comme ca :
<?php $requete="SELECT * FROM reception ORDER BY date DESC LIMIT 0,10 WHERE date=date('Y-m-d')" ?>
.Zoro.
Messages postés
263
Date d'inscription
mardi 17 août 2010
Statut
Membre
Dernière intervention
8 mai 2020
33
22 févr. 2011 à 11:23
22 févr. 2011 à 11:23
pour la syntaxe,
je mettrait des guillemets autour de la date
WHERE date="date('Y-m-d')"
je mettrait des guillemets autour de la date
WHERE date="date('Y-m-d')"