Skip to content

Commit

Permalink
Fix bad SQL spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
ginatrapani committed May 29, 2012
1 parent a2c7a0b commit c835bc4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions webapp/_lib/model/class.PostMySQLDAO.php
Expand Up @@ -143,11 +143,11 @@ public function getRepliesToPost($post_id, $network, $order_by = 'default', $uni
$class_name = ucfirst($network) . 'Plugin';
$ordering = @call_user_func($class_name.'::repliesOrdering', $order_by);
if (empty($ordering)) {
$ordering = 'pub_date ASC';
$ordering = "pub_date ASC ";
} else {
$ordering .= ', pub_date ASC';
$ordering .= ", pub_date ASC ";
}
$q .= ' ORDER BY ' . $ordering;
$q .= "ORDER BY " . $ordering. " ";

if ($count > 0) {
$q .= "LIMIT :start_on_record, :limit;";
Expand Down Expand Up @@ -1561,9 +1561,9 @@ private function calculateDistanceInMiles($distance_in_km) {
* Both arrays are sorted by number of use, descending.
*/
public function getClientsUsedByUserOnNetwork($author_id, $network) {
$q = "SELECT COUNT(*) AS num_posts, source";
$q .= " FROM #prefix#posts ";
$q .= "WHERE author_user_id = :author_id AND network = :network";
$q = "SELECT COUNT(*) AS num_posts, source ";
$q .= "FROM #prefix#posts ";
$q .= "WHERE author_user_id = :author_id AND network = :network ";
$q .= "GROUP BY source";
$vars = array(
':author_id'=>(string)$author_id,
Expand All @@ -1579,7 +1579,7 @@ public function getClientsUsedByUserOnNetwork($author_id, $network) {
$q .= " FROM #prefix#posts ";
$q .= " WHERE author_user_id = :author_id AND network = :network";
$q .= " ORDER BY pub_date DESC";
$q .= " LIMIT 25) p";
$q .= " LIMIT 25) p ";
$q .= "GROUP BY source";
$vars = array(
':author_id'=>(string)$author_id,
Expand Down

0 comments on commit c835bc4

Please sign in to comment.