Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Delisle <marc@infomarc.info>2007-03-31 16:19:02 +0400
committerMarc Delisle <marc@infomarc.info>2007-03-31 16:19:02 +0400
commite3012401d4c80189754c7e1ca1604d7180a24c3d (patch)
tree337ec92d7e5aa22cb874e9999b5a057b7e3453ab /tbl_replace.php
parentf7d9e324a1bf2e469438d714fdfb09fb546fe294 (diff)
insert a row if BLOB is empty
Diffstat (limited to 'tbl_replace.php')
-rw-r--r--tbl_replace.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/tbl_replace.php b/tbl_replace.php
index 3aa2625189..8b23482fda 100644
--- a/tbl_replace.php
+++ b/tbl_replace.php
@@ -228,7 +228,10 @@ foreach ($loop_array as $primary_key) {
// i n s e r t
if ($is_insert) {
// no need to add column into the valuelist
- $query_values[] = $cur_value;
+ if (strlen($cur_value)) {
+ $query_values[] = $cur_value;
+ $query_fields[] = PMA_backquote($key);
+ }
// u p d a t e
} elseif (!empty($me_fields_null_prev[$key])
@@ -270,10 +273,6 @@ unset($me_fields_prev, $me_funcs, $me_fields_type, $me_fields_null, $me_fields_n
// Builds the sql query
if ($is_insert && count($value_sets) > 0) {
- // first inserted row -> prepare template
- foreach ($me_fields as $key => $val) {
- $query_fields[] = PMA_backquote($key);
- }
$query[] = 'INSERT INTO ' . PMA_backquote($GLOBALS['db']) . '.' . PMA_backquote($GLOBALS['table'])
. ' (' . implode(', ', $query_fields) . ') VALUES (' . implode('), (', $value_sets) . ')';