21,882
社区成员
发帖
与我相关
我的任务
分享
<form method="post" action="check.php">
<input type="text" name="test">
<input type="hidden" name="action" value="send">
<input type="submit" name="Submit" value="提交">
</form>
<?php
$conn = mysql_connect("127.0.0.1:8889","root","root");
$action = $_POST['action'];
if($action == 'send'){
$test = $_POST['test'];
mysql_select_db("test3",$conn);
$sql = ("update tll set count=count+1 where tl01='$test'");
$result = mysql_query($sql,$conn);
}
?>
<form method="post" action="check.php">
<input type="text" name="test[]"> <br />
<input type="text" name="test[]"> <br />
<input type="text" name="test[]"> <br />
<input type="hidden" name="action" value="send">
<input type="submit" name="Submit" value="提交">
</form>
<?php
$conn = mysql_connect("127.0.0.1:8889","root","root");
$action = $_POST['action'];
if($action == 'send'){
$test = $_POST['test[]'];
mysql_select_db("test3",$conn);
$sql = ("update tll set count=count+1 where tl01='$test'");
$result = mysql_query($sql,$conn);
}
?>
的话就完全行不通了 ,实在不懂,请大神帮忙看下改下代码,十分感谢!$conn = mysql_connect("127.0.0.1:8889","root","root");
$action = $_POST['action'];
if($action == 'send'){
$test = join("','", $_POST['test']);
mysql_select_db("test3",$conn);
$sql = ("update tll set count=count+1 where tl01 in ('$test')");
$result = mysql_query($sql,$conn);
}