summaryrefslogtreecommitdiff
path: root/db/update.d/01_faq.php
diff options
context:
space:
mode:
authorJan-Philipp Litza <janphilipp@litza.de>2011-12-27 13:22:43 +0100
committerJan-Philipp Litza <janphilipp@litza.de>2011-12-27 13:22:43 +0100
commite90e6085dfd35ee101e43b0fa0f84a71a19f7208 (patch)
tree79dfce1522e0f38e73f44bd8e6f78fbd2141657f /db/update.d/01_faq.php
parent60810251e5d22e716107169b37f40072876a7f43 (diff)
fixed various bug in DB update scripts
Diffstat (limited to 'db/update.d/01_faq.php')
-rw-r--r--db/update.d/01_faq.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/db/update.d/01_faq.php b/db/update.d/01_faq.php
index 92a7376d..1e32f1ad 100644
--- a/db/update.d/01_faq.php
+++ b/db/update.d/01_faq.php
@@ -7,7 +7,8 @@ if(sql_num_query("DESCRIBE `FAQ` `Sprache`") === 0) {
while($row = mysql_fetch_assoc($res)) {
$question = explode('<br>', $row['Frage'], 2);
$answer = explode('<br>', $row['Antwort'], 2);
- sql_query("INSERT INTO `FAQ` (`Frage`, `Antwort`, `Sprache`) VALUES ('" . sql_escape(trim($question[1])) . "', '" . sql_escape(trim($answer[1])) . "', 'en')");
+ if(count($question) == 2 && count($answer) == 2)
+ sql_query("INSERT INTO `FAQ` (`Frage`, `Antwort`, `Sprache`) VALUES ('" . sql_escape(trim($question[1])) . "', '" . sql_escape(trim($answer[1])) . "', 'en')");
sql_query("UPDATE `FAQ` SET `Frage` = '" . sql_escape(trim($question[0])) . "', `Antwort` = '" . sql_escape(trim($answer[0])) . "', `Sprache` = 'de' WHERE `FID` = " . $row['FID']);
}