<?php include 'blogpost.php'; $connection = mysql_connect('localhost', 'login_h', '1234') or die ("<p class='error'>Sorry, we were unable to connect to the database server.</p>"); $database = "articles"; mysql_select_db($database, $connection) or die ("<p class='error'>Sorry, we were unable to connect to the database.</p>"); function GetBlogPosts($inId=null, $inTagId =null) { $query = null; if (!empty($inId)) { $query = mysql_query("SELECT * FROM blog_posts WHERE id = " . $inId . " ORDER BY id DESC"); } else { $query = mysql_query("SELECT * FROM blog_posts ORDER BY id DESC"); } $postArray = array(); while ($row = mysql_fetch_assoc($query)) { $myPost = new BlogPost($row["id"], $row['title'], $row['post'], $row['postfull'], $row["author_id"], $row['date_up']); array_push($postArray, $myPost); } return $postArray; } ?>
var_dump(???);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)