我使用的php脚本是用来观看videos.Last的2-3天左右,我有1k在线的人在同一时间,现在我得到了随机的内部服务器错误times.When我的网站得到了较少的访问者数量,我从来没有见过这个错误。
<?php
include('config.php');
if($site[cache]>=3)
include('cache.head.php');
$tsef=htmlspecialchars($_GET[sef]);
$query=mysql_query("SELECT tag FROM tags WHERE sef='$tsef' LIMIT 1");
@mysql_query("UPDATE tags SET views=views+1 WHERE sef='$tsef'");
**$tag=mysql_result($query,0);**
$tkeywords=explode(' ',$tag);
?>我想我需要一些缓存机制,因为我看到我的虚拟主机service.But的进程限制接近最大值,我不知道热wo实现。
发布于 2013-08-07 03:39:53
这个错误表明您的查询没有返回任何行;您不能无中生有地读取列。URL中没有与"sef“值匹配的标记。我不认为这与你的服务器负载问题有关。
让我们把它清理一下:
include('config.php');
if ($site[cache] >= 3)
include('cache.head.php');
$tsef = mysql_real_escape_string(htmlspecialchars($_GET['sef']));
$result = mysql_query("SELECT tag FROM tags WHERE sef='$tsef' LIMIT 1");
$tkeywords = array();
if ($result && mysql_num_rows($result) > 0) {
$tag = msyql_result($result, 0);
$tkeywords = explode(' ', $tag);
mysql_query("UPDATE tags SET views=views+1 WHERE sef='$tsef'");
}https://stackoverflow.com/questions/18088935
复制相似问题