我试图发布此更早,并认为我会检查回来,等待同行审查,但在我回来它已经走了,我希望我不会不必要地转贴。我在前一篇文章中对我的长期缺席表示歉意。我还在寻找以下行似乎是麻烦的,因为一切最终都会被放入我的数据库:表格内
echo "<td>". 'Tags:<input type="text" name= "MyTag" size="20">'. "</td>";
这里有两个文件我用,没有错误消息,只是没有进入MyTag场数据库:
<?php
$connect= mysql_connect('localhost', '', '');
if($connect)
{
echo("
Connected");
}
else
{
echo("
Not Connected");
}
mysql_select_db('');
$sql = "select `rebus_tbl2`.`MyOrder`,`rebus_tbl2`.`Word`,`rebus_tbl2`.`Translation`,`rebus_tbl2`.`Picture`,`rebus_t bl2`.`Person`,`rebus_tbl2`.`Picture2`,`rebus_tbl2`.`Object`,`rebus_tbl2`.`Scene`,`rebus_tbl2`.`Tag` from `rebus_tbl2`";
$query = mysql_query($sql);
if (!$query) {
die(mysql_error());
}
echo "<table border='1'>
<table bgcolor='#FF7F50'>
<tr>
<th>MyOrder</th>
<th><font color='red'>Word</font></th>
<th>Translation</th>
<th>Picture</th>
<th>Person</th>
<th>Picture2</th>
<th>Object</th>
<th>Scene</th>
<th>Tag</th>
<th> Control Panel
</tr>";
while ($row = mysql_fetch_array($query)) {
echo "<tr>";
echo "<td>" . $row['MyOrder'] . "</td>";
echo "<td>" . $row['Word'] . "</td>";
echo "<td>" . $row['Translation'] . "</td>";
echo "<td>" ."<img src=\"". $row['Picture'] ."\" alt=\"\" />". "</td>";
echo "<td>" . $row['Person'] . "</td>";
echo "<td>" ."<img src=\"". $row['Picture2'] ."\" alt=\"\" />". "</td>";
echo "<td>" ."<img src=\"". $row['Object'] ."\" alt=\"\" />". "</td>";
echo "<td>" . $row['Scene'] . "</td>";
echo "<td>" . $row['Tag']. "</td>";
echo "<td>". '<form method="post" action="Voting_Submission_Form_to_Voting_Table.php">'."</td>" ;
echo "<td>". 'Tags:<input type="text" name= "MyTag" size="20">'. "</td>";
echo "<td>" . '<input type="radio" name = "Likes" Value = "Like" <name> Likes';
echo "<td>" . '<input type="radio" name = "Adds" Value = "Name" <name> Adds';
echo "<td>" . '<input type="radio" name = "Spelling" Value = "Spelling" <name> Spelling';
echo "<td>" . '<input type="radio" name = "Inappropriate" Value = "Inappropriate" <name> Inappropriate';
echo "<td>". '<INPUT TYPE="SUBMIT" VALUE="Submit" NAME="B1">'."</TD>";
echo "</tr>";
}
echo "</table>";
?>
而且Voting_Submission_Form_to_Voting_Table.php文件
<?php
$connect= mysql_connect('localhost', '', '');
if($connect)
{
echo("
Connected");
}
else
{
echo("
Not Connected");
}
mysql_select_db('');
$MyOrder = $_Post['MyOrder'];
$MyTag = $_POST['MyTag'];
$Likes = $_POST['Likes'];
$Adds = $_POST['Adds'];
$Spelling = $_POST['Spelling'];
$Inappropriate = $_POST['Inappropriate'];
if($_POST)
{
echo("
Posted Successfully");
}
else
{
echo("
Posted Unsuccessfully");
}
$order = "INSERT INTO Voting_Table
(MyOrder, MyTag, Likes, Adds, Spelling, Inappropriate)
VALUES
('$MyOrder','$MyTag', '$Likes', '$Adds', '$Spelling', '$Inappropriate')";
$result = mysql_query($order);
if($result)
{
echo("
Input data is succeed");
}
else
{
echo("
Input data is fail");
}
?>
你想发布整个表还是什么?如果是这样 - 为什么? – Kleskowy 2014-09-24 15:08:44
我们需要了解数据发布后会发生什么 – 2014-09-24 15:09:58
*“不插入从表单输入的数据”* - INSERT在哪里?另外,如果这是你的代码'5echo'的一部分,请删除'5'。 – 2014-09-24 15:11:31