| @@ 1182-1188 (lines=7) @@ | ||
| 1179 | "SELECT * FROM $dbase.`" . $table_prefix . "site_tmplvars` WHERE name='$name'"); |
|
| 1180 | if (mysqli_num_rows($rs)) { |
|
| 1181 | $insert = true; |
|
| 1182 | while ($row = mysqli_fetch_assoc($rs)) { |
|
| 1183 | if (!mysqli_query($sqlParser->conn, |
|
| 1184 | "UPDATE $dbase.`" . $table_prefix . "site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};")) { |
|
| 1185 | echo mysqli_error($sqlParser->conn) . PHP_EOL; |
|
| 1186 | ||
| 1187 | return; |
|
| 1188 | } |
|
| 1189 | $insert = false; |
|
| 1190 | } |
|
| 1191 | echo " $name: " . $_lang['upgraded'] . PHP_EOL; |
|
| @@ 373-379 (lines=7) @@ | ||
| 370 | $rs = mysqli_query($sqlParser->conn, "SELECT * FROM $dbase.`" . $table_prefix . "site_tmplvars` WHERE name='$name'"); |
|
| 371 | if (mysqli_num_rows($rs)) { |
|
| 372 | $insert = true; |
|
| 373 | while($row = mysqli_fetch_assoc($rs)) { |
|
| 374 | if (!mysqli_query($sqlParser->conn, "UPDATE $dbase.`" . $table_prefix . "site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};")) { |
|
| 375 | echo "<p>" . mysqli_error($sqlParser->conn) . "</p>"; |
|
| 376 | return; |
|
| 377 | } |
|
| 378 | $insert = false; |
|
| 379 | } |
|
| 380 | echo "<p> $name: <span class=\"ok\">" . $_lang['upgraded'] . "</span></p>"; |
|
| 381 | } else { |
|
| 382 | //$q = "INSERT INTO $dbase.`" . $table_prefix . "site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc',(SELECT (CASE COUNT(*) WHEN 0 THEN 0 ELSE `id` END) `id` FROM $dbase.`" . $table_prefix . "categories` WHERE `category` = '$category'),$locked,'$input_options','$output_widget','$output_widget_params','$input_default');"; |
|