Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
$questID = ; //keine Ahnung wie ich an die Werte noch ran komme
$questTitle = ;
$questDescription = ;
$characterID = ;
$questMoney = getCharacters('levelID') * rand(1,4);
$questExperience = getCharacters('levelID') * rand(50,200);
$questTime = 150 * rand(1,4);
function listRandomQuests() {
global $db, $characterID;
if(mysqli_query($db, "SELECT count(*) FROM character_quests WHERE characterID = $characterID") > 0) {
$sql = "
SELECT
questName,
questDescription,
questGold,
questExperience,
questTime
FROM
character_quests
WHERE
characterID = $characterID
ORDER BY
questTime ASC
";
$result = $db->query($sql);
$rows = array();
while($row = $result->fetch_object()) {
$rows[] = $row;
}
foreach($rows as $row) {
echo "<div>";
echo "<input id='$row->questName' type='radio' name='randomQuest' value='$row->questName' />";
echo "<label for='$row->questName'>";
echo "<span class='yellow'>$row->questName</span>";
echo "<br />";
echo "$row->questDescription";
echo "</label>";
echo "</div>";
}
} else {
$sql = "
INSERT INTO
character_quests(
questID,
questTitle,
questDescription,
characterID,
questMoney,
questExperience,
questTime
)
VALUES
(
?, ?, ?, ?, ?, ?, ?
)
";
$stmt = $db->prepare($sql);
$stmt->bind_param (
'issiiii',
$questID,
$questTitle,
$questDescription,
$characterID,
$questMoney,
$questExperience,
$questTime
);
$stmt->close();
}
}