diff --git a/ChangeLog b/ChangeLog index 1a0ac1cd1..8c9c1b7c3 100755 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ $Source$ * lang/galician: update, thanks to Xosé Calvo * lang/chinese_*: update, thanks to Siu Sun (siusun) * lang/indonesion: update, thanks to Rachim Tamsjadi (tamsy) + * tbl_replace.php3: inserts and foreign keys, thanks to Markus L. Noga 2002-09-23 Loïc Chapeaux * libraries/display_tbl.lib.php3, tbl_change.php3: coding standards diff --git a/tbl_replace.php3 b/tbl_replace.php3 index 30169f54c..e50f42e22 100755 --- a/tbl_replace.php3 +++ b/tbl_replace.php3 @@ -224,6 +224,20 @@ else { $val = "''"; } break; + case '$foreign$': + // if we have a foreign key, then construct the value + $f = 'field_' . md5($key); + if (!empty($$f)) { + $val = implode(',', $$f); + if ($val == 'null') { + // void + } else { + $val = "'" . PMA_sqlAddslashes(urldecode($val)) . "'"; + } + } else { + $val = "''"; + } + break; default: if (get_magic_quotes_gpc()) { $val = "'" . str_replace('\\"', '"', $val) . "'";