Ok ok , hum deja ya u ntruc qui risque de faire planter ton script , tu declar 2 foi la variable $sql :
$sql$sql
<?
include("design/header.php");
require("config.php");
?>
<SCRIPT language="JavaScript">
function checknumber(){
var x=document.checknum.pnum.value
var anum=/(^\d+$)|(^\d+.\d+$)/
if (anum.test(x) && x>0)
testresult=true
else{
alert("Entrez une quantité valide")
testresult=false
}
return (testresult)
}
function checkban(){
if (document.layers||document.all||document.getElementById)
return checknumber()
else
return true
}
</SCRIPT>
<?
$sql = "SELECT id_pro,titre_prod,im_prod,detail_prod,ref_prod,pxht_prod,promo_prod,pxhtpromo_prod FROM $table_produit where id_pro='$article'";
$requete = mysql_query($base,$sql);
$titre = mysql_fetch_array($requete,0,"titre_prod");
$image =mysql_fetch_array($requete,0,"im_prod");
$pxht = mysql_fetch_array($requete,0,"pxht_prod");
$promo =mysql_fetch_array($requete,0,"promo_prod");
$pxpromo = mysql_fetch_array($requete,0,"pxhtpromo_prod");
echo"<td bgcolor=\"$barre1\"><a href=\"index.php\"><font color=\"$police3\" size=\"$width_police2\"><strong>Accueil</a> > $titre</strong></font></td>
</tr>
<tr>
<td><br>";
?>
[/code]
Pour afficher les donnée d'une table je fé comme sa :
<?
$db = mysql_connect($dbhost, $dblogin, $dbpassword);
mysql_select_db($dbname);
$sql= "SELECT `msg` FROM `msgdujour`";
$result = mysql_query($sql);
// tant qu'il y a des fiches
while ($val = mysql_fetch_array($result)) { ?>
<? echo $val["msg"]; ?>
<br>
<? }
?>