1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| <?php
//donne les informations sur la connection de la base de données
Define("CONNEXION","curl");
Define("MYSQL",true);
if (MYSQL) {
$host="localhost";
$user="root";
$pwd="";
$base="base";
$mysql_link = mysql_connect($host,$user,$pwd);
$test=mysql_pconnect($host,$user,$pwd) or die(mysql_error());
mysql_select_db($base);
}
//requête SQL
$sql = "SELECT * FROM table";
$result = mysql_query($sql);
//affichage des données sur la page
while ($row=mysql_fetch_array($result)) {
echo $row['colonne'];
echo "<br>";}
?> |