for Loic
This commit is contained in:
@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
|
||||
$Id$
|
||||
$Source$
|
||||
|
||||
2002-09-04 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
||||
* tbl_change.php3: protect with backquotes
|
||||
|
||||
2002-09-03 Marc Delisle <lem9@users.sourceforge.net>
|
||||
* tbl_change.php3: drop-down for foreign keys, patch 603939,
|
||||
thanks to markus at noga.de
|
||||
|
@@ -379,29 +379,28 @@ for ($i = 0; $i < $fields_cnt; $i++) {
|
||||
$foreign_field = $foreigner['foreign_field'];
|
||||
$foreign_display = PMA_getDisplayField($foreign_db, $foreign_table);
|
||||
|
||||
// FIXME: not using foreign_db
|
||||
$dispsql= "SELECT $foreign_field,$foreign_display FROM $foreign_table";
|
||||
|
||||
$dispsql = 'SELECT ' . PMA_backquote($foreign_field) . ', ' . PMA_backquote($foreign_display)
|
||||
. ' FROM ' . PMA_backquote($foreign_db) . '.' . PMA_backquote($foreign_table);
|
||||
// lem9: put a LIMIT in case of big foreign table (looking for better
|
||||
// solution, maybe a configurable limit, or a message?)
|
||||
$dispsql .= " LIMIT 100";
|
||||
$dispsql .= ' LIMIT 100';
|
||||
$disp = PMA_mysql_query($dispsql);
|
||||
echo '<td bgcolor="$bgcolor">' . "\n";
|
||||
|
||||
echo ' <td bgcolor="' . $bgcolor . '">' . "\n";
|
||||
echo ' <select name="fields[' . urlencode($field) . ']">' . "\n";
|
||||
while ($relrow = @PMA_mysql_fetch_array($disp)) {
|
||||
$key = $relrow[$foreign_field];
|
||||
$value = $relrow[$foreign_display];
|
||||
echo ' <option value="' . $key. '"';
|
||||
echo ' <option value="' . urlencode($key) . '"';
|
||||
if ($key == $data) {
|
||||
echo ' selected="selected"';
|
||||
} // end if
|
||||
echo '>' . $key . '-' . $value. '</option>' . "\n";
|
||||
echo '>' . htmlspecialchars($key) . '-' . htmlspecialchars($value) . '</option>' . "\n";
|
||||
} // end while
|
||||
echo ' </select>' . "\n";
|
||||
echo ' </td>' . "\n";
|
||||
} else
|
||||
|
||||
if (strstr($row_table_def['True_Type'], 'text')) {
|
||||
}
|
||||
else if (strstr($row_table_def['True_Type'], 'text')) {
|
||||
?>
|
||||
<td bgcolor="<?php echo $bgcolor; ?>">
|
||||
<?php echo $backup_field . "\n"; ?>
|
||||
|
Reference in New Issue
Block a user