- Timestamp:
- 05/29/06 23:02:55 (2 years ago)
- Files:
-
- 1 modified
-
branches/asze/common/functions_blog.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/asze/common/functions_blog.php
r158 r160 87 87 header("Location: login.php"); 88 88 } 89 } 90 /* }}} */ 91 /* get_authors() {{{ */ 92 /** 93 * Get all the authors into an array. 94 */ 95 function get_authors() { 96 $res =& $GLOBALS["db"]->query("SELECT * FROM authors"); 97 if (PEAR::isError($res)) { 98 die($res->getMessage()); 99 } 100 while ($res->fetchInto($row, DB_FETCHMODE_ASSOC)) { 101 $authors[$row["id"]] = $row["fullname"]; 102 } 103 return $authors; 89 104 } 90 105 /* }}} */ … … 164 179 function show_article($id) { 165 180 //get all the authors in an array 166 $res =& $GLOBALS["db"]->query("SELECT * FROM authors"); 167 168 if (PEAR::isError($res)) { 169 die($res->getMessage()); 170 } 171 172 while ($res->fetchInto($row, DB_FETCHMODE_ASSOC)) { 173 $authors[$row["id"]] = $row["fullname"]; 174 } 181 $authors = get_authors(); 175 182 //same with categories 176 183 $res =& $GLOBALS["db"]->query("SELECT * FROM categories"); … … 716 723 717 724 //get all the authors in an array 718 $res =& $db->query("SELECT * FROM authors"); 719 if (PEAR::isError($res)) { 720 die($res->getMessage()); 721 } 722 while ($res->fetchInto($row, DB_FETCHMODE_ASSOC)) { 723 $authors[$row["id"]] = $row["fullname"]; 724 } 725 $authors = get_authors(); 725 726 //same with categories 726 727 $res =& $db->query("SELECT * FROM categories");
