<?php include('core/init.inc.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset="windows-1250"> <title>Polna Pljuca Blog</title> </head> <body> <div> <?php $posts = get_posts(); /* print_r($posts);*/ foreach ($posts as $post){ ?> <h2><?php echo $post['title']; ?></h2> <h4>By <?php echo $post['user']; ?> on <?php echo ['date']; ?></h4> <h4><?php echo $post['total_comments']; ?> comments, last comment <?php echo ['last_comment']; ?></h4> <hr /> <p><?php echo $post['preview']; ?></p> <?php } ?> </div> </body> </html>i get that Parse error: syntax error, unexpected '[' in /Applications/XAMPP/xamppfiles/htdocs/blog/blog_list.php on line 25
and if i use like this:
<?php include('core/init.inc.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset="windows-1250"> <title>Polna Pljuca Blog</title> </head> <body> <div> <?php $posts = get_posts(); print_r($posts); /*foreach ($posts as $post){ ?> <h2><?php echo $post['title']; ?></h2> <h4>By <?php echo $post['user']; ?> on <?php echo ['date']; ?></h4> <h4><?php echo $post['total_comments']; ?> comments, last comment <?php echo ['last_comment']; ?></h4> <hr /> <p><?php echo $post['preview']; ?></p> <?php } */ ?> </div> </body> </html>
i get this error Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /Applications/XAMPP/xamppfiles/htdocs/blog/core/inc/posts.inc.php on line 48
won't stop reloading the page.
can you help me pleas....