|
// includes
include("conf.php");
include("functions.php");
// open database connection
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
// select database
mysql_select_db($db) or die ("Unable to select database!");
// generate and execute query
$query = "SELECT * FROM cornintro ORDER BY id DESC";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
// if records present
if (mysql_num_rows($result) > 0)
{
// iterate through resultset
// print title with links to edit and delete scripts
while($row = mysql_fetch_object($result))
{
?>
echo $row->titel; ?> echo $row->link; ?> echo nl2br($row->content); ?> } } else { ?> DATENBANK ERROR! TILT! } // close connection mysql_close($connection); ?> |