PHP syntax error “unexpected $end”

前端 未结 7 843
清酒与你
清酒与你 2020-12-02 01:52

I have 3 files 1) show_createtable.html 2) do_showfielddef.php 3) do_showtble.php

1) First file is for creating a new table for a data base, it is a fom with 2 input

7条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-02 02:25

    Your for loop is not terminated. You are missing a }

    for ($i = 0; $i < count($_POST[field_name]); $i++) {
      $sql .= $_POST[field_name][$i]." ".$_POST[field_type][$i];
    }

    And as pointed by others there is also a missing } for the last if statement:

    if ($result) {
      $msg = "< p>" .$_POST[table_name]." has been created!< /p>";
    }

提交回复
热议问题