1

我有一个在 phpMyAdmin 中运行的查询,它返回结果,但如果我将查询剪切并粘贴到网页上的 php 脚本中,查询似乎运行但页面上没有显示任何内容。它也没有完成加载页面。该页面在我的查询开始的地方结束。与通过 phpMyAdmin 运行的查询相比,基于 Web 的查询的执行时间是否可能太长?这是查询:

$query = "SELECT DISTINCT tblCertificates.WebReportedDt, tblInsHeader.name1, tblInsHeader.name2, tblQuotes.certnum, tblQBalloons.regnum
FROM ((`tblQuotes`
INNER JOIN `tblInsHeader` ON tblQuotes.insuredid = tblInsHeader.insuredid)
INNER JOIN `tblQBalloons` ON tblQuotes.quoteid = tblQBalloons.quoteid)
INNER JOIN `tblCertificates` ON tblQuotes.quoteid = tblCertificates.QuoteID
WHERE (((tblCertificates.WebReportedDt) IS NOT NULL)AND ((tblCertificates.web) = True) AND tblCertificates.WebReportedDt >= '".$MyDate."')
ORDER BY tblCertificates.WebReportedDt DESC , tblInsHeader.name1, tblQuotes.certnum, tblQBalloons.regnum";
$results = mysql_query($query) or die("Query Timed out");
  while ($r = mysql_fetch_array($results)) {
extract ($r);
 echo $WebReportedDt." - ".$name1." ".$name2." - ".$certnum." - ".$regnum."<br>";
}

MyDate var 是 DATETIME 格式的当前日期 (YYYY-mm-dd HH:ii:ss)。

任何想法都会有所帮助。

谢谢!

4

1 回答 1

0

感谢您的建议。原来我需要增加执行时间。查询时间过长,php 超时。

于 2012-10-26T21:08:37.753 回答