我正在使用以下代码在 mysql 数据库中插入数据
<?php
$con = mysql_connect("surveyipad.db.6420177.hostedresource.com","test","test");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("surveyipad", $con);
$response_id=$_POST['response_id'];
$participant_id=$_POST['participant_id']
$question_id=$_POST['question_id'];
$answer_text=$_POST['answer_text'];
echo($response_id);
$query=("INSERT INTO survey_question_responses
(response_id,participant_id,question_id,answer_option)
VALUES ('$response_id', '$participant_id','$question_id','$answer_option')");
mysql_query($query,$con);
printf("Records inserted: %d\n", mysql_affected_rows());
echo($response_id)
?>
我在mysql中的表就像
response_id,participant_id,question_id,answer_option_answer_text