Kage Kazumi
10-19-2012, 08:00 PM
Dreamweaver is popping a syntax error for line 8 (below), but I'm just starting out and can't figure out what is the issue. The Code:
<?php
include ('includes/connect.php');
function getPosts()) {
$query = mysql_query("SELECT * From posts") or die (mysql_error());
while($post = mysql_fetch_assoc($query)) {
echo "<h2>" . $post['Title'] . "by" . $post['Author'] . "</h2>";
echo $post['Content'];
}
}
?>
I am following a Youtube tutorial (http://www.youtube.com/watch?v=u3ry84gg0fw) and it looks the same as in the video and it executes in the video (12:23 time frame in video).
Note: Doing this on a localhost and not a live host.
<?php
include ('includes/connect.php');
function getPosts()) {
$query = mysql_query("SELECT * From posts") or die (mysql_error());
while($post = mysql_fetch_assoc($query)) {
echo "<h2>" . $post['Title'] . "by" . $post['Author'] . "</h2>";
echo $post['Content'];
}
}
?>
I am following a Youtube tutorial (http://www.youtube.com/watch?v=u3ry84gg0fw) and it looks the same as in the video and it executes in the video (12:23 time frame in video).
Note: Doing this on a localhost and not a live host.