|  : |
$db_host = "sql.free.fr";
$db_user = "cespoir";
$db_pass = "eyamooyo";
$database_name = "cespoir";
$table_name = "journal";
$connection = mysql_connect($db_host,$db_user,$db_pass)
or die("Connexion impssible vers mysql."); /* Connecting to MySQL define host,username,password */
$db = mysql_select_db($database_name,$connection) or die("Connexion impossible vers la base."); /* Select Database, define the DBname you created */
$sql = "SELECT date,topic,entry, auteur,courriel,stit FROM $table_name WHERE typ='A' and valide='YN' order by date desc"; /* Selecting to show the date, topic, entry on the page. Sorting by date with most recent at the top. */
$sql_result = mysql_query($sql, $connection) or die("Actuellement rien en attente...");
while ($row = mysql_fetch_array($sql_result)) { /*setting up array and defining result values */
$date = $row["date"];
$topic = $row["topic"];
$stit = $row["stit"];
$entry = $row["entry"];
$auteur = $row["auteur"];
$courriel = $row["courriel"];//print results in html
echo "";
echo "
| $date |
| $topic |
| $stit |
$entry$auteur $courriel
|
";
}
/* Free resultset */
mysql_free_result($sql_result);
/* Closing connection */
mysql_close($connection);
/* Fin table php */
echo " ";
?>
|
|