从 A页面上传过来的值(已经存到数据库里了)'say'(新闻内容)
在B页面接受之后echo他到内容框里 之后在内容框里修改
之后B页面上发到B页面上 接受之后update(把改完的数据接受并且插入到数据库里替换原先的) 在改新闻这里卡住了 大家帮帮忙帮我看下代码 指点指点
//B页面上的内容框
<textarea name='sa' cols='80' rows='25'>
<?
//接受从A页面上传过来的say(新闻内容)
$w=$_REQUEST['say'];
echo $w; ?>
</textarea> <br>
<input type="submit" value="上传">
<input type="hidden" name="chaozuo" value="gengxi">
<input type="reset" value="重置">
//B页面上接受B页面内容框的内容(name='sa')
并且连接数据库更新原数据
<?
$s=$_REQUEST['sa'];
$ma=new mysqli('localhost','root','admin','xwfb');
if(mysqli_connect_errno())
{
echo "连接数据库失败";
exit;
}
//更新数据 表 列=本页面上接受的'sa' 如果 列=B页面上传过来的内容
$oo="update nrb set neirong='$s' where neirong='$w'";
$msq=$ma->query($oo);
echo $msq;
}
?>
在B页面接受之后echo他到内容框里 之后在内容框里修改
之后B页面上发到B页面上 接受之后update(把改完的数据接受并且插入到数据库里替换原先的) 在改新闻这里卡住了 大家帮帮忙帮我看下代码 指点指点
//B页面上的内容框
<textarea name='sa' cols='80' rows='25'>
<?
//接受从A页面上传过来的say(新闻内容)
$w=$_REQUEST['say'];
echo $w; ?>
</textarea> <br>
<input type="submit" value="上传">
<input type="hidden" name="chaozuo" value="gengxi">
<input type="reset" value="重置">
//B页面上接受B页面内容框的内容(name='sa')
并且连接数据库更新原数据
<?
$s=$_REQUEST['sa'];
$ma=new mysqli('localhost','root','admin','xwfb');
if(mysqli_connect_errno())
{
echo "连接数据库失败";
exit;
}
//更新数据 表 列=本页面上接受的'sa' 如果 列=B页面上传过来的内容
$oo="update nrb set neirong='$s' where neirong='$w'";
$msq=$ma->query($oo);
echo $msq;
}
?>
因为你用内容做条件,不太合适.
$msq=mssql->query($oo);
if( $msq )
{
echo 'success';
}
else
{
echo 'unsuccess';
}