Requete Sql et fpdf Format date
Prout
-
prout -
prout -
Bonjour, j' ai une requête Sql qui fonctionne très bien sur Mysql
SELECT RAISONSOCIALE, Commune, EDE, DATE_FORMAT( DAteV, '%d/%m/%Y' ) , ToProductGlobal, t_technicien.nom, idOP
FROM t_commune, t_diagnostic, t_exploitation, t_technicien
WHERE t_exploitation.CodeCommune = t_commune.CodeCommune
AND t_technicien.idTec = t_diagnostic.idTec
AND t_exploitation.Siret = t_diagnostic.Siret;
J' obtient la date sous un bon format JJ-MM-AAAA.
Je voudrais obtenir un tableau sous le format PDF en utilisant fdpf....Si je laisse la requête comme dans mysql j'ai une erreur du type "FPDF error: Some data has already been output, can't send PDF file"
Si j'enlève le format de la date J'ai aucun bug ....
J'ai essayé de faire une fonction juste après la requete et j'ai toujours la meme erreur.
SELECT RAISONSOCIALE, Commune, EDE, DATE_FORMAT( DAteV, '%d/%m/%Y' ) , ToProductGlobal, t_technicien.nom, idOP
FROM t_commune, t_diagnostic, t_exploitation, t_technicien
WHERE t_exploitation.CodeCommune = t_commune.CodeCommune
AND t_technicien.idTec = t_diagnostic.idTec
AND t_exploitation.Siret = t_diagnostic.Siret;
J' obtient la date sous un bon format JJ-MM-AAAA.
Je voudrais obtenir un tableau sous le format PDF en utilisant fdpf....Si je laisse la requête comme dans mysql j'ai une erreur du type "FPDF error: Some data has already been output, can't send PDF file"
Si j'enlève le format de la date J'ai aucun bug ....
$result=mysql_query("select RAISONSOCIALE, Commune, EDE, DAteV, ToProductGlobal,t_technicien.nom,idOP
from t_commune, t_diagnostic, t_exploitation, t_technicien
where t_exploitation.CodeCommune = t_commune.CodeCommune
and t_technicien.idTec = t_diagnostic.idTec
and t_exploitation.Siret = t_diagnostic.Siret")or die(mysql_error());
J'ai essayé de faire une fonction juste après la requete et j'ai toujours la meme erreur.
A voir également:
- Requete Sql et fpdf Format date
- Format epub - Guide
- Format factory - Télécharger - Conversion & Codecs
- Hp usb disk storage format tool - Télécharger - Stockage
- Format dat - Guide
- Format apfs - Guide
1 réponse
Problème résolu en transformant simplement la date
<?php $result=mysql_query("select RAISONSOCIALE, Commune, EDE, DateV, ToProductGlobal,t_technicien.nom,idOP
from t_commune, t_diagnostic, t_exploitation, t_technicien
where t_exploitation.CodeCommune = t_commune.CodeCommune
and t_technicien.idTec = t_diagnostic.idTec
and t_exploitation.Siret = t_diagnostic.Siret")or die(mysql_error());
while($row = mysql_fetch_array($result))
{
$DateV = $row["DateV"];
//Formatage de la dateDiagnostic pour PDF
$DateTest ="";
$tab = explode("-",$DateV);
$DateTest = $tab[2].'-'.$tab[1].'-'.$tab[0];
}
?>