mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-05-01 03:39:21 +02:00
charactersearch widget: fix Invalid argument
PHP Warning: Invalid argument supplied for foreach() in layout/widgets/charactersearch.php on line 22 This happens when the database has no players, during fresh install.
This commit is contained in:
parent
855c889568
commit
91816bbe2b
@ -19,9 +19,9 @@
|
|||||||
if ($cache->hasExpired()) {
|
if ($cache->hasExpired()) {
|
||||||
$names_sql = mysql_select_multi('SELECT `name` FROM `players` ORDER BY `name` ASC;');
|
$names_sql = mysql_select_multi('SELECT `name` FROM `players` ORDER BY `name` ASC;');
|
||||||
$names = array();
|
$names = array();
|
||||||
foreach ($names_sql as $name) {
|
if ($names_sql !== false): foreach ($names_sql as $name) {
|
||||||
$names[] = $name['name'];
|
$names[] = $name['name'];
|
||||||
}
|
} endif;
|
||||||
$cache->setContent($names);
|
$cache->setContent($names);
|
||||||
$cache->save();
|
$cache->save();
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user