PHP空白页面。 [英] PHP Blank Page.

查看:63
本文介绍了PHP空白页面。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,


我之前发布的这是一个空白的php页面。我已经在php.ini中启用了日志记录

ALL,但没有。如果我在

中更改包含文件的数据库名称,我会收到一条错误消息,所以我猜这意味着它是连接到mysql数据库的
。我已经为这个页面添加了几行

代码:


index.php

<?php

session_start();

require_once(''inc / db_config.inc.php'');

$ conn = db_connect();

$ sqlsu =" SELECT * FROM subject ORDER BY ID" ;;

$ ressu = mysql_query($ sqlsu,$ conn);

if(mysql_num_rows($ ressu)){

while($ qry = mysql_fetch_array($ ressu)){

$ cat = stripSlashes($ qry [''cat'' ]);

$ resns = mysql_query(" SELECT * FROM questions WHERE test LIKE''$ cat''",

$ conn);

$ numcat = mysql_num_rows($ resns);


inc / db_config.inc.php

函数db_connect()

{

$ result = @mysql_pconnect(''localhost'',''root'',''密码);

if(!$ result)

返回false;

if(!@mysql_select_db(''quiz''))

返回false;


返回$ result;

}

?>

Ok,

I posted earlier about this, a blank php page. I''ve enabled logging
ALL in the php.ini, but nothing. If I change the name of the db in
the include file, I get an error message, so I guess this means it''s
connecting to the mysql db. I''ve included the first couple lines of
code for this page:

index.php
<?php
session_start();
require_once(''inc/db_config.inc.php'');
$conn = db_connect();
$sqlsu = "SELECT * FROM subjects ORDER BY ID";
$ressu = mysql_query($sqlsu, $conn);
if (mysql_num_rows($ressu)) {
while ($qry = mysql_fetch_array($ressu)) {
$cat = stripSlashes($qry[''cat'']);
$resns = mysql_query("SELECT * FROM questions WHERE test LIKE ''$cat''",
$conn);
$numcat = mysql_num_rows($resns);

inc/db_config.inc.php
function db_connect()
{
$result = @mysql_pconnect(''localhost'', ''root'', ''password);
if (!$result)
return false;
if (!@mysql_select_db(''quiz''))
return false;

return $result;
}
?>

推荐答案

conn = db_connect();
conn = db_connect();


sqlsu =" SELECT * FROM subject ORDER BY ID" ;;
sqlsu = "SELECT * FROM subjects ORDER BY ID";


ressu = mysql_query(
ressu = mysql_query(


这篇关于PHP空白页面。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆