Skip to content

Commit

Permalink
Changed generator for displaying foreign keys (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
JPPhoto authored Jun 11, 2022
1 parent 724315e commit 9a5304c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/generate.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,9 @@ function generate($postdata) {
$sql = "SELECT *,'. $fk_column .' FROM '. $fk_table . '";
$result = mysqli_query($link, $sql);
while($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
array_pop($row);
$value = implode(" | ", $row);
$duprow = $row;
unset($duprow["' . $fk_column . '"]);
$value = implode(" | ", $duprow);
if ($row["' . $fk_column . '"] == $' . $columnname . '){
echo \'<option value="\' . "$row['. $fk_column. ']" . \'"selected="selected">\' . "$value" . \'</option>\';
} else {
Expand Down

0 comments on commit 9a5304c

Please sign in to comment.