Quote:
Originally Posted by Chicago_VLNU_4s
doesnt work, it just displays that whole code on my homepage template
|
You need to put "<?" or "<?php" around the code.
PHP Code:
<?
$conn = mysql_connect("localhost", "username", "password") or die(mysql_error());
$query = "SELECT pagetext FROM post ORDER BY dateline DESC LIMIT 1";
$result = mysql_query($query) or die(mysql_error());
while (list($pagetext = mysql_fetch_array($result)))
{
echo $pagetext;
}
?>
Also, don't forget to change the strings "username" & "password"