|
Posted by techjohnny@gmail.com on 06/19/07 17:18
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;
}
?>
Navigation:
[Reply to this message]
|