紧急求救!!!MySQL莫名停止运行!!!

monkeyqq 2002-03-29 10:38:42
我的配置是win2k server + PHP4.1.1 + MySQL3.23.34 + iis5.0
我在一个PHP文件里加入以下几段代码后,MySQL就频繁的自动停止运行,而且总是在第二段代码运行完之后停止。苦思几日没有结果,头都大了,大家快帮我想想办法吧!
代码段1:
<?//连接数据库
require("connection.php");
//包含文件
require("functions.php");?>
<?//查询数据库
$sqld="select texts from news ";
$row=mysql_query($sqld);
while(list($texts)=mysql_fetch_row($row))
{echo "<p> </p>";
echo $texts;
echo "<p></p>";}
?>

代码段2:
<?//查询数据库
$sql="select name,author,types,counter,pyname from book order by id desc limit 0,10";
$result=mysql_query($sql);

//显示相应内容
while(list($name,$author,$types,$counter,$pyname)=mysql_fetch_row($result))
{echo "<tr>\n";
echo "<td align='center'><a href='".$PHP_SELF."?names=".$name."'>$name</a></td>"; //数据链接地址,传递的参数可以实现下载计数
echo "<td ></td>";
echo "<td align='center' >";
echo "<a href='common.php?theauthor=".$author."&no=1' >$author</a></td>";
echo "<td ></td>";
echo "<td align='center' >";
echo "<a href='common.php?thetype=".$types."&no=1' >$types</a></td>";
echo "<td ></td>";
echo "<td align='center' >$counter";
picture("$counter",$pyname);
echo "</td>";
echo "</tr>\n";}
?>

代码段3:
<?
//查询数据库
$sql="select name,author,types,counter,pyname from book order by counter desc limit 0,10";
$results=mysql_query($sql);


//显示相应内容
while(list($name,$author,$types,$counter,$pyname)=mysql_fetch_row($results))
{echo "<tr>\n";
echo "<td align='center'><a href='".$PHP_SELF."?names=".$name."'>$name</a></td>"; //数据链接地址,传递的参数可以实现下载计数
echo "<td ></td>";
echo "<td align='center' >";
echo "<a href='common.php?theauthor=".$author."&no=1' >$author</a></td>";
echo "<td ></td>";
echo "<td align='center' >";
echo "<a href='common.php?thetype=".$types."&no=1' >$types</a></td>";
echo "<td ></td>";
echo "<td align='center' >$counter";
picture("$counter",$pyname);
echo "</td>";
echo "</tr>\n";}


//下载次数计数
counter($names); ?>


其中,functions.php的内容如下:
<?
//动态图片生成函数
function picture($counter,$pyname)
{
//创建图形
$image=imagecreate(80,10);
$black=imagecolorallocate($image,0,0,0);
$white=imagecolorallocate($image,255,255,255);
$green=imagecolorallocate($image,100,220,100);
$blue=imagecolorallocate($image,200,240,210);
imagerectangle($image,0,0,79,9,$white);
imagefilledrectangle($image,0,0,79,9,$white);
imageline($image,0,0,79,0,$black);
imageline($image,0,9,79,9,$black);
imageline($image,0,0,0,9,$black);
imageline($image,79,0,79,9,$black);


//取下载次数
$i=$counter;
$multiple=$counter;
$i=(string)$i;
$long=strlen($i);
$powervalue=pow(10,$long);
$x=(80/$powervalue)*$multiple;

//填充颜色
imagefilledrectangle($image,1,3,$x,6,$green);
imageline($image,1,2,$x,2,$blue);
imageline($image,1,7,$x,7,$blue);

//生成图片
imagepng($image,"images/png/$pyname.png");
imagedestroy($image);
echo "<img src='images/png/$pyname.png' >";
}
?>



connection.php内容如下:
<?
//修改下面代码来联接数据库
$mysql=mysql_connect("localhost","root","**********");
mysql_select_db("elibrary",$mysql);
?>

...全文
50 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
monkeyqq 2002-04-03
  • 打赏
  • 举报
回复
没有人知道怎么回事么?我很急呀!!!!!!
monkeyqq 2002-03-29
  • 打赏
  • 举报
回复
没有吧,我检查过了
qsnake 2002-03-29
  • 打赏
  • 举报
回复
程序有问题吧?是不是死循环了

21,891

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧