Ett stycke php-kod:
<?php
// Connects to your Database
mysql_connect("$host", "$user", "$pass") or die(mysql_error());
mysql_select_db("$db") or die(mysql_error());
$data = mysql_query("SELECT * FROM news")
or die(mysql_error());
?>
Ett stycke php-kod:
<?php
while($post = mysql_fetch_array( $data ))
{
Print "<h3>";
Print " ".$post['title'] . " ";
Print "</h3> <p>";
Print " ".$post['text'] . " ";
Print "</h3><br />Posted by: ".$post['by'] . " <br /> ";
Print "<CENTER>";
Print " ".$post['picture'] . " ";
Print "</CENTER>";
}
?>
/party