Skip to content

Commit e3c156a

Browse files
committed
Frobernation!
1 parent 6b0aa5b commit e3c156a

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

LICENSE

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
===
2-
Whube base code, copyright Whube team, 2010, AGPLv3
3-
===
41
GNU AFFERO GENERAL PUBLIC LICENSE
52
Version 3, 19 November 2007
63

model/bug.php

+9-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,18 @@
2121
class bug extends dbobj {
2222
function bug() {
2323
dbobj::dbobj("bugs", "bID"); // SQL table `bugs', PK `bID'
24+
// this just calls the super-class's constructor
25+
// this tells the dbobj sutff to use the the
26+
// `bugs' table, with a primary key of `bID'.
2427
}
2528
// Let's add in some functionallity for user stuff.
2629
function getOwner( $bID ) {
27-
$this->getAllByPK( $bID );
30+
$this->getAllByPK( $bID ); // get everything
31+
// that matches the PK
32+
// being = to $bID
2833
$row = $this->getNext();
34+
// get the next (and hopefully
35+
// only ) row
2936
$u = new user();
3037
$u->getAllByPK( $row['owner'] );
3138
return $u->getNext(); // ( first row :P )
@@ -48,7 +55,7 @@ function getProject( $pID ) {
4855
function getAllBugs() {
4956
global $TABLE_PREFIX;
5057
$sql = new sql();
51-
$sql->query("SELECT * FROM " . $TABLE_PREFIX . "bugs;" );
58+
$sql->query("SELECT * FROM " . $TABLE_PREFIX . "bugs ORDER BY bID DESC;" );
5259
$ret = array();
5360
while ( $row = $sql->getNextRow() ) {
5461
array_push( $ret, $row );

0 commit comments

Comments
 (0)