Voici le code que tu peux utiliser :
PHP Code:
//require_once(../01-bareme/00/php/config.php');
$products_server = 'localhost';
$products_database = 'shop';
$products_user = 'root';
$products_password = '';
$products_conn = new mysqli($products_server, $products_user, $products_password, $products_database);
ob_start();
if ($products_conn->connect_errno)
{
echo "Failed to connect to MySQL: (" . $products_conn->connect_errno . ") " . $products_conn->connect_error;
}
$rs_results = $products_conn->query("SELECT * FROM figurine ORDER BY id");
while ($row = $rs_results->fetch_array())
{
$data[] = $row;
}
printf("<p>En test</p>");
printf("<p>N'oubliez pas de lire les règles sous onglet de barre de navigation</p>");
printf("<table width='1102' height='79' border='1'>");
printf("<tr>");
printf("<th width='42' style='width:20px;height:23px;' scope='col'>N°</th>");
printf("<th width='55' style='width:58px;' scope='col'>-= Figurine =-</th>");
printf("<th width='41' style='width:10px;' scope='col'>boîte</th>");
printf("<th width='81' style='width:10px;' scope='col'>chevelure</th>");
printf("<th width='45' style='width:10px;' scope='col'>corps</th>");
printf("<th width='57' style='width:10px;' scope='col'>casque</th>");
printf("<th width='67' style='width:10px;' scope='col'>plastron</th>");
printf("<th width='77' style='width:10px;' scope='col'>épaulette</th>");
printf("<th width='41' style='width:10px;' scope='col'>brasL</th>");
printf("<th width='41' style='width:10px;' scope='col'>brasR</th>");
printf("<th width='40' style='width:10px;' scope='col'>main</th>");
printf("<th width='67' style='width:10px;' scope='col'>ceinture</th>");
printf("<th width='45' style='width:10px;' scope='col'>tibias</th>");
printf("<th width='59' style='width:10px;' scope='col'>mèche </th>");
printf("<th width='36' style='width:10px;' scope='col'>tête</th>");
printf("<th width='50' style='width:10px;' scope='col'>genou</th>");
printf("<th width='48' style='width:10px;' scope='col'>totem</th>");
printf("<th width='98' style='width:10px;' scope='col'>accessoire</th>");
printf("</tr>");
foreach ($data AS $rrows)
{
printf("<tr>");
printf("<td style='text-align: center' scope='col'>%s</td>", $rrows['id']);
printf("<td style='text-align: center' scope='col'>%s</td>", $rrows['nom']);
printf("<td style='text-align: center' scope='col'>%s €</td>", $rrows['prix_boite']);
printf("<td style='text-align: center' scope='col'>%s €</td>", $rrows['prix_chevelure']);
printf("<td style='text-align: center' scope='col'>%s €</td>", $rrows['prix_corps']);
printf("<td style='text-align: center' scope='col'>%s €</td>", $rrows['prix_casque']);
printf("<td style='text-align: center' scope='col'>%s €</td>", $rrows['prix_plastron']);
printf("<td style='text-align: center' scope='col'>%s €</td>", $rrows['prix_epaulette']);
printf("<td style='text-align: center' scope='col'>%s €</td>", $rrows['prix_bras_g']);
printf("<td style='text-align: center' scope='col'>%s €</td>", $rrows['prix_bras_d']);
printf("<td style='text-align: center' scope='col'>%s €</td>", $rrows['prix_main']);
printf("<td style='text-align: center' scope='col'>%s €</td>", $rrows['prix_ceinture']);
printf("<td style='text-align: center' scope='col'>%s €</td>", $rrows['prix_tibias']);
printf("<td style='text-align: center' scope='col'>%s €</td>", $rrows['prix_meche']);
printf("<td style='text-align: center' scope='col'>%s €</td>", $rrows['prix_tete']);
printf("<td style='text-align: center' scope='col'>%s €</td>", $rrows['prix_genou']);
printf("<td style='text-align: center' scope='col'>%s €</td>", $rrows['prix_totem']);
printf("<td style='text-align: center' scope='col'>%s €</td>", $rrows['prix_accessoire']);
printf("</tr>");
}
printf("</table>");
ob_end_flush();
$products_conn->close();
Comment