|
楼主 |
发表于 2004-7-7 13:54:56
|
显示全部楼层
<?php
$id=trim($HTTP_GET_VARS['id']);
$author=trim($HTTP_POST_VARS['author']);
$title=trim($HTTP_POST_VARS['title']);
$source=trim($HTTP_POST_VARS['source']);
$content=trim($HTTP_POST_VARS['content']);
$link_id= mysql_connect("localhost","root" );
mysql_select_db("cqedu",$link_id);
if(!$link_id)
{
echo "<html><head><title>Error</title></head><body>";
echo "连接数据库失败";
echo "</body></html>";
exit();
}
$date1=date("Y-m-d H-i-s");
$str_sql= "update fuwu set title='$title',date='$date1',author='$author',content='$content',source='$source' where id='$id'";
//echo "$str_sql";
//exit ();
$result = mysql_query($str_sql);
header("Location:fuwumanage.php");
//echo "$result";
//exit ();
/*if(!$result)
{
print('MySQL 选择命令执行错误');
exit();
}
$number_of_rows= @mysql_num_rows($result);
echo "$number_of_rows";
//exit ();
if($number_of_rows<1)
{
print("数据库里没有记录!");
exit();
}
else
{
$record = mysql_fetch_object($result);
// print "<html><head><title>新闻内容</title></head>";
// print "<body>";
// print ("[新闻]-->[".$record->category."]");
print ("   ".$record->title."<p></p>".$record->author."<p></p>  ".$record->source."<p></p>  ".$record->content."<p></p>");
// print"</body></html>";
} */
?> |
|