Surement un bête prob, mais plus c'est bête et plus cela me prend du temps, alors un ptit coup de manivelle me ferai du bien!!!!
J'ai créé une table avec un champ nomé prix format double : valeur par ex 2.2
Quand je reprend la table sur tableau la variable prix deviens string.
J'ai tout essayer sauf la bonne solution que jespére vous aller me donner pour que la variable $prix reprenne le format double.
Quand j'essaye de la cahnger de format le résultat est 0.2
Le prob c'est quand je calcule ma variable $prix valeur 2.2 X 2 j'obtient 4 au lieu de 4.4
Voici :ex echo $prix*2; me donne 4 au lieu de 4.4 ?????
// crée un tableau variable et affiche les moulures à l'écran
echo('<table border="1" width="100%" height="20"><tr><td width="200" ></td></tr>');
$query = "SELECT * FROM moulures ORDER BY num";
$result = mysql_query($query);
while ($cat = mysql_fetch_array($result)) {
$a ==1;
$ref[$a]=($cat["ref"]);
$deno[$a]=($cat["denomination"]);
$prix[$a]=($cat["prix"]);
$largeur[$a]=($cat["largeur"]);
$profondeur[$a]=($cat["profondeur"]);
$couleur[$a]=($cat["couleur"]);
$choix[$a]=($cat["choix"]);
$a++;
}
mysql_close();
echo "<table border="1" width="100%"><tr><td width="44">"."Réf"." </td>
<td width="250">"."Dénomination"." </td><td></td><td width="51">"."Largeur"." <td width="70">"."Prix"." </td></td></tr></table>";
$nb = $a;
$start = 1;
$nb_images = 45;
$start = $_REQUEST['start'];
$nbr=$nb_images;
$i = $start+1;
while ($i <= $start + $nbr)
{
if ($i < $a){
$c0="";
$c4 = strlen($ref["$i"]);
$c4 = 5-$c4;
for ($b=0;$b<$c4;$b++){
$c0.="0";
}
$c2="-EL.jpg";
$c3 = $c0.$ref["$i"].$c2;
echo "<table border="1" width="100%"><tr><td width="44">".$ref["$i"]." </td>
<td width="250">".$deno["$i"]." </td><td><a target="_blank"title="clique pour agrandir ..." href="
http://www.cadrix.be/moulures1/$c3" >"."<img src="
http://www.cadrix.be/moulures1/$c3" width="400" ></td><td width="51">".$largeur[$i]."mm"." </td><td width="70">"."<a href="calculreserve.php?deno=.$deno[$i].&ref=.$ref[$i].&largeur=.$largeur[$i].&prix=.$prix[$i].">"."calculer"." </td></tr></table>";
}
$i++;
}
if($start >= $nb_images) echo '<a href="?start='.($start - $nb_images ).'">page précédente </a> ';
for($b = 0, $b1=1; $b <=$a; $b+=45, $b1++)
{
echo '<a href="?start='.($b).' & $i ='.($b+1).'">'.$b1.'</a> ';
}
if(($nb > $nb_images)&&($i < $nb)) echo '<a href="?start='.($i++ - 1 ).'"> page suivante</a>';
?>
</body>
</html>
Surement un bête prob, mais plus c'est bête et plus cela me prend du temps, alors un ptit coup de manivelle me ferai du bien!!!!
J'ai créé une table avec un champ nomé prix format double : valeur par ex 2.2
Quand je reprend la table sur tableau la variable prix deviens string.
J'ai tout essayer sauf la bonne solution que jespére vous aller me donner pour que la variable $prix reprenne le format double.
Quand j'essaye de la cahnger de format le résultat est 0.2
Le prob c'est quand je calcule ma variable $prix valeur 2.2 X 2 j'obtient 4 au lieu de 4.4
Voici :ex echo $prix*2; me donne 4 au lieu de 4.4 ?????
// crée un tableau variable et affiche les moulures à l'écran
echo('<table border="1" width="100%" height="20"><tr><td width="200" ></td></tr>');
$query = "SELECT * FROM moulures ORDER BY num";
$result = mysql_query($query);
while ($cat = mysql_fetch_array($result)) {
$a ==1;
$ref[$a]=($cat["ref"]);
$deno[$a]=($cat["denomination"]);
$prix[$a]=($cat["prix"]);
$largeur[$a]=($cat["largeur"]);
$profondeur[$a]=($cat["profondeur"]);
$couleur[$a]=($cat["couleur"]);
$choix[$a]=($cat["choix"]);
$a++;
}
mysql_close();
echo "<table border="1" width="100%"><tr><td width="44">"."Réf"." </td>
<td width="250">"."Dénomination"." </td><td></td><td width="51">"."Largeur"." <td width="70">"."Prix"." </td></td></tr></table>";
$nb = $a;
$start = 1;
$nb_images = 45;
$start = $_REQUEST['start'];
$nbr=$nb_images;
$i = $start+1;
while ($i <= $start + $nbr)
{
if ($i < $a){
$c0="";
$c4 = strlen($ref["$i"]);
$c4 = 5-$c4;
for ($b=0;$b<$c4;$b++){
$c0.="0";
}
$c2="-EL.jpg";
$c3 = $c0.$ref["$i"].$c2;
echo "<table border="1" width="100%"><tr><td width="44">".$ref["$i"]." </td>
<td width="250">".$deno["$i"]." </td><td><a target="_blank"title="clique pour agrandir ..." href="http://www.cadrix.be/moulures1/$c3" >"."<img src="http://www.cadrix.be/moulures1/$c3" width="400" ></td><td width="51">".$largeur[$i]."mm"." </td><td width="70">"."<a href="calculreserve.php?deno=.$deno[$i].&ref=.$ref[$i].&largeur=.$largeur[$i].&prix=.$prix[$i].">"."calculer"." </td></tr></table>";
}
$i++;
}
if($start >= $nb_images) echo '<a href="?start='.($start - $nb_images ).'">page précédente </a> ';
for($b = 0, $b1=1; $b <=$a; $b+=45, $b1++)
{
echo '<a href="?start='.($b).' & $i ='.($b+1).'">'.$b1.'</a> ';
}
if(($nb > $nb_images)&&($i < $nb)) echo '<a href="?start='.($i++ - 1 ).'"> page suivante</a>';
?>
</body>
</html>