发送页:<form name="form_work" method="post" action="index.php?lfj=$lfj&dirname=$dirname&file=$file&job=work&action=px">
<input name="listdb[{$rs[uid]}]" type="text" value="$rs[px]" /><input type="submit" name="Submit" value="修改" />接受页:elseif($action=='px')
{
@extract($_POST);
$db->query("UPDATE '{$_pre}company' SET 'px'='$px' WHERE uid='$uid'"); refreshto($FROMURL,"修改成功");
}
<input name="listdb[{$rs[uid]}]" type="text" value="$rs[px]" /><input type="submit" name="Submit" value="修改" />接受页:elseif($action=='px')
{
@extract($_POST);
$db->query("UPDATE '{$_pre}company' SET 'px'='$px' WHERE uid='$uid'"); refreshto($FROMURL,"修改成功");
}
$sql="UPDATE '{$_pre}company' SET 'px'='$px' WHERE uid='$uid'";
$res = mysql_query($sql);
if(!$res)
die("SQL:{$sql}<br>Error:".mysql_error());
if(mysql_affected_rows() > 0){
echo "修改成功";
/*查询的二维结果数组
$arr = array();
while($rows = mysql_fetch_array(MYSQL_ASSOC)){
array_push($arr,$rows);
}
*/
}else{
echo "修改失败<br>Error:".mysql_error();
}
{
@extract($_POST);
$query = $db->query("UPDATE '{$_pre}company' SET 'px'='$px' WHERE uid='$uid'");
echo $query;//妞,让我看看是什么
refreshto($FROMURL,"修改成功");
}
很感谢5楼的热情解答
但是我用了以后有下面这个提示
SQL:UPDATE 'qb_hy_company' SET 'px'='' WHERE uid=''
Error:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''qb_hy_company' SET 'px'='' WHERE uid=''' at line 1
但是我用了以后有下面这个提示
数据库连接出错:UPDATE 'qb_hy_company' SET 'px'='' WHERE uid=''You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''qb_hy_company' SET 'px'='' WHERE uid=''' at line 1
1064
网页正在跳转当中,请稍候...修改成功