cvs: pearweb /include pear-database-note.php pear-database-statistics.php

From: Date: Sun, 09 Mar 2008 20:42:07 +0000
Subject: cvs: pearweb /include pear-database-note.php pear-database-statistics.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-7324@lists.php.net to get a copy of this message
dufuz Sun Mar 9 20:42:07 2008 UTC Modified files: /pearweb/include pear-database-note.php pear-database-statistics.php Log: Cosmetics http://cvs.php.net/viewvc.cgi/pearweb/include/pear-database-note.php?r1=1.3&r2=1.4&diff_format=u Index: pearweb/include/pear-database-note.php diff -u pearweb/include/pear-database-note.php:1.3 pearweb/include/pear-database-note.php:1.4 --- pearweb/include/pear-database-note.php:1.3 Wed Dec 5 22:14:28 2007 +++ pearweb/include/pear-database-note.php Sun Mar 9 20:42:07 2008 @@ -10,7 +10,7 @@ */ class note { - static function add($key, $value, $note, $author = "") + static function add($key, $value, $note, $author = '') { global $dbh, $auth_user; if (empty($author)) { @@ -34,8 +34,7 @@ static function remove($id) { global $dbh; - $id = (int)$id; - $res = $dbh->query("DELETE FROM notes WHERE id = $id"); + $res = $dbh->query('DELETE FROM notes WHERE id = ' . (int)$id); if (DB::isError($res)) { return $res; } @@ -55,8 +54,7 @@ static function getAll($user) { global $dbh; - return $dbh->getAll('SELECT id, nby, ntime, note FROM notes' - . ' WHERE uid = ? ORDER BY ntime', - array($user)); + $sql = 'SELECT id, nby, ntime, note FROM notes WHERE uid = ? ORDER BY ntime'; + return $dbh->getAll($sql, array($user)); } } \ No newline at end of file http://cvs.php.net/viewvc.cgi/pearweb/include/pear-database-statistics.php?r1=1.4&r2=1.5&diff_format=u Index: pearweb/include/pear-database-statistics.php diff -u pearweb/include/pear-database-statistics.php:1.4 pearweb/include/pear-database-statistics.php:1.5 --- pearweb/include/pear-database-statistics.php:1.4 Sat Dec 29 00:14:01 2007 +++ pearweb/include/pear-database-statistics.php Sun Mar 9 20:42:07 2008 @@ -18,7 +18,7 @@ | Martin Jansen <mj@php.net> | | Gregory Beaver <cellog@php.net> | +----------------------------------------------------------------------+ - $Id: pear-database-statistics.php,v 1.4 2007/12/29 00:14:01 dufuz Exp $ + $Id: pear-database-statistics.php,v 1.5 2008/03/09 20:42:07 dufuz Exp $ */ class statistics @@ -43,9 +43,9 @@ $query = 'SELECT s.release, s.dl_number, s.last_dl, r.releasedate ' . 'FROM package_stats AS s ' . 'LEFT JOIN releases AS r ON (s.rid = r.id) ' - . "WHERE pid = " . (int)$id; + . 'WHERE pid = ' . (int)$id; if (!empty($rid)) { - $query .= " AND rid = " . (int)$rid; + $query .= ' AND rid = ' . (int)$rid; } $query .= ' GROUP BY rid ORDER BY rid DESC';

« previous php.pear.core (#7324) next »