Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added Entry

Entry now displaying on index.php!!! FUCK YEAH!!!
  • Loading branch information...
commit 4c7f11f0cbd6aae09479acfb0fc2e55860a393fc 1 parent d85762d
@Zebediah Zebediah authored
Showing with 9 additions and 5 deletions.
  1. +1 −1  inc/db.inc.php
  2. +3 −3 inc/functions.inc.php
  3. +5 −1 index.php
View
2  inc/db.inc.php
@@ -6,7 +6,7 @@
* Time: 8:57 PM
* To change this template use File | Settings | File Templates.
*/
-define('DB_INFO', 'mysql:host=localhost;dbname=blog');
+define('DB_INFO', 'mysql:host=localhost;dbname=cornball');
define('DB_USER', 'root');
define('DB_PASS', '');
View
6 inc/functions.inc.php
@@ -14,7 +14,7 @@ function retrieve_entries($db, $id=NULL) {
if(isset($id))
{
//load specified entry
- $sql = "SELECT title, entry, date_format(created, '%W, %M %D, %Y') as created FROM entries WHERE id=? LIMIT 1";
+ $sql = "SELECT title, entry, date_format(created, '%W, %M %D, %Y') as created, entry FROM entries WHERE id=? LIMIT 1";
$stmt = $db->prepare($sql);
$stmt->execute(array($_GET['id']));
@@ -22,11 +22,11 @@ function retrieve_entries($db, $id=NULL) {
$fulldisp = 1;
}else {
//load all entry titles
- $sql = "SELECT id, title, date_format(created, '%W, %M %D, %Y') as created FROM entries ORDER BY created DESC";
+ $sql = "SELECT id, title, date_format(created, '%W, %M %D, %Y') as created, entry FROM entries ORDER BY created DESC";
//loop through returned results adn store as an array
foreach($db->query($sql) as $row)
{
- $e[]=array('id'=> $row['id'], 'title'=>$row['title'], 'created'=>$row['created']);
+ $e[]=array('id'=> $row['id'], 'title'=>$row['title'], 'created'=>$row['created'], 'entry'=>$row['entry']);
}
//set the fulldisp flag for multiple entries
$fulldisp = 0;
View
6 index.php
@@ -20,6 +20,7 @@
<div id="wrapper">
<h1 id='blog'>Blog Entries</h1>
+ <!--<?php print_r($e);?>-->
<?php
if($fulldisp == 1)
{
@@ -39,10 +40,13 @@
?>
<p id="entries">
<p>
- <a href="index.php?id=<?php print $entry['id'];?>">
+ <a href="index.php?id=<?php print($entry['id']);?>">
<?php echo $entry['title'];?>
<br>
<?php echo "Created: " . $entry['created'];?>
+ <br>
+ <br>
+ <?php echo $entry['entry'];?>
</a>
</p>
</p>
Please sign in to comment.
Something went wrong with that request. Please try again.