Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图在表单提交上插入值,但没有任何结果在数据库中输入,甚至没有空值,
if(isset($_POST['signup'])) { mysql_query("INSERT INTO user (fname, lname) VALUES ('Peter', 'Griffin')"); }
我检查了是否有与数据库的连接并且它已连接。任何人 ?
直接在查询浏览器或任何mysql编辑器中执行查询,检查是否插入。如果插入成功,就这样检查。
if(isset($_POST['signup'])) { echo "Inside"; exit; mysql_query("INSERT INTO user (fname, lname) VALUES ('Peter', 'Griffin')"); }
如果它不显示Inside,那么问题出在if(isset($_POST['signup'])). 核实。
if(isset($_POST['signup']))