Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Commit

Permalink
Fixed PHP 5.3 compatibility #137
Browse files Browse the repository at this point in the history
  • Loading branch information
jkroepke committed Feb 9, 2016
1 parent 56dbfd1 commit b8cf2b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/classes/Database.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@ public function selectSingle($qry, array $params = array(), $field = false)
*/
public function lists($table, $column, $key = null)
{
$selects = implode(', ', is_null($key) ? [$column] : [$column, $key]);
$selects = implode(', ', is_null($key) ? array($column) : array($column, $key));

$qry = "SELECT {$selects} FROM %%{$table}%%;";
$stmt = $this->_query($qry, array(), 'select');

$results = [];
$results = array();
if (is_null($key))
{
while ($row = $stmt->fetch(PDO::FETCH_ASSOC))
Expand Down

4 comments on commit b8cf2b7

@OzanKurt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkroepke PHP 5.3 is dead, why do you still want to support it?

@jkroepke
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicht, nicht direkt. Aber aktuell nutzt 2Moons an alle stellen noch den alten array-Syntax.

Und solange man den Mensch aus #137 mit der kleinen Änderung glücklich macht. warum nicht.

@OzanKurt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, yeah. Hahaha :D Nice thing! ;)

@Natrios
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not work to find players, alliances, planets etc.
in the search after entering the nickname or the first letter,
show a table with the name, the alliance, planet position and ranking.
However, it does not show the player list etc.

Any help?

Please sign in to comment.