Affichage image d'un base de données mysql
Bonjour tout le monde
Je stock des images dans ma bd
Je souhaite les afficher dans une celule d'un tableau.
Voici le code qui contien des erreur.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
<?php
include("id.inc.php");
$lien = mysql_connect($bdserver, $bdlogin, "");
mysql_select_db($bdd);
$sql = "SELECT * FROM $tblog";
$sqlim = "SELECT image FROM $tblog";
$result = mysql_query($sql);
$affimage = mysql_query($sqlim);
echo "<TABLE BORDER=1 style=BORDER-COLOR:#FF0033>";
$col = mysql_fetch_row($affimage);
while ($habitat = mysql_fetch_array($result)){
$id = $habitat['ref_loge'];
$desig = $habitat['titre'];
$vl = $habitat['locvente'];
$px = $habitat['prix'];
$dpt = $habitat['departement'];
$vil = $habitat['ville'];
$texte =$habitat['information'];//ligne 324
$type = $habitat['genre'];
$genretype = $habitat['type'];//ligne 327
$date = $habitat['date'];
header("Content-type: " .$col[1]);//ici erreur
echo "<tr><td>$col[2]</td>";
echo "<td>Besoin information</td></tr>";
echo "<tr><td>$texte</td>";
echo "<td>$px</td></tr>";
}
echo "</TABLE>";
mysql_close($lien);
?> |
Erreur
Citation:
Notice: Undefined offset: 1 in C:\Program Files\EasyPHP 2.0b1\www\index.php on line 324
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\EasyPHP 2.0b1\www\index.php:258) in C:\Program Files\EasyPHP 2.0b1\www\index.php on line 324
Notice: Undefined index: 2 in C:\Program Files\EasyPHP 2.0b1\www\index.php on line 327
Comment regler ce problème.
Merci
A +