Eléphant du PHP |
88 Messages
21 janv. 2007, 17:41
Bon je suis extrêmement mélanger mais en gros je veux créer un system de liste d'articles tel que :

(si ce croqui n'apparit pas cliquez-ici)
http://zakaria.naoura.free.fr/a.bmp
Comment créer un répétition de cadre en fonction de chaque enregistrement avec du php dans chacun des cadres comme pour les forms...
voici le code avec les cadres + php :
<table border="1" width="209" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#076BA7">
<tr>
<td dir="ltr" bgcolor="#659AC5">
<font color="#FFFFFF">
<?php
{
$a = mysql_connect('sql.free.fr', 'info.aqua', '*******') or die('Erreur de connexion '.mysql_error());
mysql_select_db('info.aqua',$a) or die('Erreur de selection '.mysql_error());
$b = mysql_query("SELECT titre FROM article WHERE");
while ($c = mysql_fetch_array($b))
echo $c[0].' '.$c[1];
}
mysql_close($a);
?>
</font>
</td>
</tr>
<tr>
<td dir="ltr">
<table border="0" width="700" cellspacing="0" cellpadding="0">
<tr>
<td width="100">
</td>
<td> </td>
</tr>
<tr>
<td width="100">
</td>
<td><font color="#076BA7"><?php
{
$d = mysql_connect('sql.free.fr', 'info.aqua', '*******') or die('Erreur de connexion '.mysql_error());
mysql_select_db('info.aqua',$d) or die('Erreur de selection '.mysql_error());
$e = mysql_query("SELECT sous_titre FROM article WHERE");
while ($f = mysql_fetch_array($e))
echo $f[0].' '.$f[1];
}
mysql_close($d);
?></font></td>
</tr>
<tr>
<td width="100">
</td>
<td> </td>
</tr>
<tr>
<td width="100">
</td>
<td><font color="#076BA7">De <?php
{
$g = mysql_connect('sql.free.fr', 'info.aqua', '*******') or die('Erreur de connexion '.mysql_error());
mysql_select_db('info.aqua',$g) or die('Erreur de selection '.mysql_error());
$h = mysql_query("SELECT numero_client FROM article WHERE");
while ($i = mysql_fetch_array($h))
echo $i[0].' '.$i[1];
}
mysql_close($g);
?> à <?php
{
$j = mysql_connect('sql.free.fr', 'info.aqua', '*******') or die('Erreur de connexion '.mysql_error());
mysql_select_db('info.aqua',$j) or die('Erreur de selection '.mysql_error());
$k = mysql_query("SELECT heure FROM article WHERE");
while ($l = mysql_fetch_array($k))
echo $l[0].' '.$l[1];
}
mysql_close($j);
?> le <?php
{
$m = mysql_connect('sql.free.fr', 'info.aqua', '*******') or die('Erreur de connexion '.mysql_error());
mysql_select_db('info.aqua',$m) or die('Erreur de selection '.mysql_error());
$n = mysql_query("SELECT date FROM article WHERE");
while ($o = mysql_fetch_array($n))
echo $o[0].' '.$o[1];
}
mysql_close($m);
?></font></td>
</tr>
<tr>
<td width="100">
</td>
<td> </td>
</tr>
<tr>
<td width="100">
</td>
<td><font color="#076BA7"><?php
{
$p = mysql_connect('sql.free.fr', 'info.aqua', '*******') or die('Erreur de connexion '.mysql_error());
mysql_select_db('info.aqua',$p) or die('Erreur de selection '.mysql_error());
$q = mysql_query("SELECT chapitre FROM article WHERE");
while ($r = mysql_fetch_array($q))
echo $r[0].' '.$r[1];
}
mysql_close($p);
?></font></td>
</tr>
<tr>
<td width="100">
</td>
<td> </td>
</tr>
<tr>
<td width="100">
</td>
<td><font color="#076BA7"><?php
{
$s = mysql_connect('sql.free.fr', 'info.aqua', '*******') or die('Erreur de connexion '.mysql_error());
mysql_select_db('info.aqua',$s) or die('Erreur de selection '.mysql_error());
$t = mysql_query("SELECT text FROM article WHERE");
while ($u = mysql_fetch_array($t))
echo $u[0].' '.$u[1];
}
mysql_close($s);
?></font></td>
</tr>
<tr>
<td width="100">
</td>
<td> </td>
</tr>
<tr>
<td width="100"> </td>
<td><font color="#076BA7"><?php
{
$v = mysql_connect('sql.free.fr', 'info.aqua', '*******') or die('Erreur de connexion '.mysql_error());
mysql_select_db('info.aqua',$v) or die('Erreur de selection '.mysql_error());
$w = mysql_query("SELECT text FROM article WHERE");
while ($x = mysql_fetch_array($w))
echo $x[0].' '.$x[1];
}
mysql_close($v);
?></font></td>
</tr>
<tr>
<td width="100"> </td>
<td> </td>
</tr>
<tr>
<td colspan="2" bgcolor="#659AC5">
<font color="#FFFFFF"> Note : <?php
{
$y = mysql_connect('sql.free.fr', 'info.aqua', '*******') or die('Erreur de connexion '.mysql_error());
mysql_select_db('info.aqua',$y) or die('Erreur de selection '.mysql_error());
$z = mysql_query("SELECT note FROM article WHERE");
while ($1 = mysql_fetch_array($z))
echo $1[0].' '.$1[1];
}
mysql_close($y);
?> / 10
Commentaire : <?php
{
$2 = mysql_connect('sql.free.fr', 'info.aqua', '*******') or die('Erreur de connexion '.mysql_error());
mysql_select_db('info.aqua',$2) or die('Erreur de selection '.mysql_error());
$3 = mysql_query("SELECT text FROM article WHERE");
while ($4 = mysql_fetch_array($3))
echo $4[0].' '.$4[1];
}
mysql_close($2);
?></font></td>
</tr>
</table>
</td>
</tr>
</table>
</tr>
Cordialement zaknaou