我正在插入来自iphone应用数据到MySQL,但它不将数据插入表 我回声结果和inputed值,但它也没有显示出任何值将数据插入不工作
HTML代码MySQL数据库
页<html>
<head>
<title>data to server</title>
</head>
<body>
<form action="surveyAnswer.php" method="post" enctype="multipart/form-data"><br>
<INPUT TYPE = "Text" VALUE ="1" NAME = "survey_question_response_id">
<INPUT TYPE = "Text" VALUE ="1" NAME = "survey_id">
<INPUT TYPE = "Text" VALUE ="1" NAME = "question_id">
<INPUT TYPE = "Text" VALUE ="1" NAME = "survey_response_answer_id">
<input type="submit" value="Upload File">
</form>
</body>
</html>
<?php
$host = "";
$user = "";
$pass = "";
$database = "";
$linkID = mysql_connect($host, $user, $pass) or die("Could not connect to host.");
mysql_select_db($database, $linkID) or die("Could not find database.");
$survey_question_response_id=$_POST['survey_question_response_id'];
$survey_id=$_POST['survey_id'];
$question_id=$_POST['question_id'];
$survey_response_answer_id=$_POST['survey_response_answer_id'];
echo($survey_question_response_id);
$query=("INSERT INTO survey_question_responses (survey_question_response_id,survey_id,question_id,survey_response_answer_id)
VALUES ('$survey_question_response_id', '$survey_id','$question_id','$survey_response_answer_id')");
mysql_query($query,$con);
printf("Records inserted: %d\n", mysql_affected_rows());
echo($survey_id)
?>
没有同样的事情再次无法正常工作 – user1567956 2012-08-03 07:26:36
请更换的mysql_query($查询,$ CON);到mysql_query($ query,$ con)或die(mysql_error());并给我们的输出 – donald123 2012-08-03 07:29:47
,你告诉我已经更新了代码,但它显示了回报[] – user1567956 2012-08-03 07:39:07