简体   繁体   English

mysql插入数据库没有值

[英]mysql insert to database no value

im trying to insert values on form submit but no result nothing is entering in the databse not even empty values, 我试图在表单提交上插入值但没有结果没有输入数据库甚至没有空值,

if(isset($_POST['signup'])) {  

    mysql_query("INSERT INTO user (fname, lname)
    VALUES ('Peter', 'Griffin')");
}

i checked if theres connection to database and it's connected. 我检查了是否连接到数据库并且已连接。 ANYONE ? 任何人 ?

Execute the query directly in query browser or any of mysql editors and check whether it is inserted. 直接在查询浏览器或任何mysql编辑器中执行查询,并检查它是否已插入。 If it is inserted successfully, just check like this. 如果插入成功,只需像这样检查。

if(isset($_POST['signup'])) {  
    echo "Inside";
    exit;
    mysql_query("INSERT INTO user (fname, lname)
    VALUES ('Peter', 'Griffin')");
}

If it doesn't display Inside , then the problem is in if(isset($_POST['signup'])) . 如果它没有显示Inside ,则问题出在if(isset($_POST['signup'])) Check it. 核实。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM