473,406 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

PHP Blank Page.

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;
}
?>

Jun 19 '07 #1
11 4954
Rik
On Tue, 19 Jun 2007 19:18:02 +0200, te********@gmail.com
<te********@gmail.comwrote:
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:
First rule of hunting errors: do not surpress any errors by @ if something
isn't working.

Second: I do not see any output, so as far as I'm concerned if you've got
no errors you would still see nothing.

- $qry['cat'] doesn't seem to be set anywhere, how come?
- check your queries for errors: echo mysql_error(), and the query itself.

--
Rik Wasmus
Jun 19 '07 #2
On Jun 19, 10:59 am, Rik <luiheidsgoe...@hotmail.comwrote:
On Tue, 19 Jun 2007 19:18:02 +0200, techjoh...@gmail.com

<techjoh...@gmail.comwrote:
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:

First rule of hunting errors: do not surpress any errors by @ if something
isn't working.

Second: I do not see any output, so as far as I'm concerned if you've got
no errors you would still see nothing.

- $qry['cat'] doesn't seem to be set anywhere, how come?
- check your queries for errors: echo mysql_error(), and the query itself.

--
Rik Wasmus
The entire page:

<?php
include('inc/header.inc.php');
require_once('inc/db_config.inc.php');
session_start();
$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);
if ($numcat 0) {
// Check if scoreboard contains entries in this category and, if so,
list results
if (isset($HTTP_SESSION_VARS['scoreboard']) &&
($HTTP_SESSION_VARS['scoreboard'][$cat])) {
$totsub = 0;
$correctans = 0;
foreach ($HTTP_SESSION_VARS['scoreboard'][$cat] as $questi)
{
if ($questi == 'c') { $correctans++; }
$totsub++;
}
}
echo "\n".'<form name="teststart'.$qry['ID'].'" action="quiz.php"
method="post">';
echo '<li><p id="hornav">';
if ((!$totsub) || ($totsub < $numcat)) {
if ($totsub) { $togo = ($numcat - $totsub); } else { $togo =
$numcat; }
echo '<select name="limit">';
if ($togo 5) { echo '<option value="5" SELECTED>5 questions</
option>'; }
for ($j = 1; $j < 12; $j++) {
if ($togo ($j * 10)) { echo '<option value="'.($j*10).'">'.($j*10).'
questions</option>'; }
}
echo '<option value="'.$togo.'">';
if ($togo 1) {echo ' all '; }
echo $togo;
if ($totsub 0) { echo ' remaining'; }
echo '</option></select>';
}
if ($totsub >= $numcat) {
echo ' Test completed</p>'; }
else if ($totsub 0) {
echo '<a href="javascript:document.teststart'.
$qry['ID'].'.submit()">Continue Test</a></p>'; }
else {
echo '<a href="javascript:document.teststart'.
$qry['ID'].'.submit()">Start Test</a></p>'; }

echo '<strong>'.$cat.'</strong';
echo '<em>('.$numcat.' questions)</em>';
echo '<br />';
echo '<input type="hidden" name="testsub" value="'.$cat.'">';
echo stripslashes($qry['descr']);

if ($totsub 0) {
echo '<h3>Total score: '.$correctans.'/'.$totsub.'</h3>';
$totsub = 0;
$correctans = 0;
}

echo '</li>'."\n".'</form>'."\n";

echo '<hr />';
}
}
}
?>

</ol>
<br />
<?php include_once('inc/footer.inc.php'); ?>

Jun 19 '07 #3
Rik
On Tue, 19 Jun 2007 20:11:44 +0200, te********@gmail.com
<te********@gmail.comwrote:
On Jun 19, 10:59 am, Rik <luiheidsgoe...@hotmail.comwrote:
>On Tue, 19 Jun 2007 19:18:02 +0200, techjoh...@gmail.com

<techjoh...@gmail.comwrote:
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:

First rule of hunting errors: do not surpress any errors by @ if
something
isn't working.

Second: I do not see any output, so as far as I'm concerned if you've
got
no errors you would still see nothing.

- $qry['cat'] doesn't seem to be set anywhere, how come?
- check your queries for errors: echo mysql_error(), and the query
itself.

The entire page:
Well, that's nice, I do not spot any clear syntax errors.(That is, if I
assume correctly that '// Check if scoreboard contains entries in this
category and, if so,list results' is on 1 single line) However, with no
query result the only output would be '</ol><br />', which obviously
doesn't show up in a browser.

Wether there's a parse error in your other includes I couldn't say.

So, check your queries, echo mysql_error(), check mysql_num_rows() and
echo it to check wether the result has data or is empty, etc.

--
Rik Wasmus
Jun 19 '07 #4
On Jun 19, 11:39 am, Rik <luiheidsgoe...@hotmail.comwrote:
On Tue, 19 Jun 2007 20:11:44 +0200, techjoh...@gmail.com

<techjoh...@gmail.comwrote:
On Jun 19, 10:59 am, Rik <luiheidsgoe...@hotmail.comwrote:
On Tue, 19 Jun 2007 19:18:02 +0200, techjoh...@gmail.com
<techjoh...@gmail.comwrote:
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:
First rule of hunting errors: do not surpress any errors by @ if
something
isn't working.
Second: I do not see any output, so as far as I'm concerned if you've
got
no errors you would still see nothing.
- $qry['cat'] doesn't seem to be set anywhere, how come?
- check your queries for errors: echo mysql_error(), and the query
itself.
The entire page:

Well, that's nice, I do not spot any clear syntax errors.(That is, if I
assume correctly that '// Check if scoreboard contains entries in this
category and, if so,list results' is on 1 single line) However, with no
query result the only output would be '</ol><br />', which obviously
doesn't show up in a browser.

Wether there's a parse error in your other includes I couldn't say.

So, check your queries, echo mysql_error(), check mysql_num_rows() and
echo it to check wether the result has data or is empty, etc.

--
Rik Wasmus
Thanks.
echo mysql_error();
Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at /www13/htdocs/quiz/inc/header.inc.php:
3) in /www13/htdocs/quiz/index.php on line 4

Jun 19 '07 #5
On Jun 19, 12:46 pm, "techjoh...@gmail.com" <techjoh...@gmail.com>
wrote:
On Jun 19, 11:39 am, Rik <luiheidsgoe...@hotmail.comwrote:
On Tue, 19 Jun 2007 20:11:44 +0200, techjoh...@gmail.com
<techjoh...@gmail.comwrote:
On Jun 19, 10:59 am, Rik <luiheidsgoe...@hotmail.comwrote:
>On Tue, 19 Jun 2007 19:18:02 +0200, techjoh...@gmail.com
><techjoh...@gmail.comwrote:
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:
>First rule of hunting errors: do not surpress any errors by @ if
>something
>isn't working.
>Second: I do not see any output, so as far as I'm concerned if you've
>got
>no errors you would still see nothing.
>- $qry['cat'] doesn't seem to be set anywhere, how come?
>- check your queries for errors: echo mysql_error(), and the query
>itself.
The entire page:
Well, that's nice, I do not spot any clear syntax errors.(That is, if I
assume correctly that '// Check if scoreboard contains entries in this
category and, if so,list results' is on 1 single line) However, with no
query result the only output would be '</ol><br />', which obviously
doesn't show up in a browser.
Wether there's a parse error in your other includes I couldn't say.
So, check your queries, echo mysql_error(), check mysql_num_rows() and
echo it to check wether the result has data or is empty, etc.
--
Rik Wasmus

Thanks.
echo mysql_error();

Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at /www13/htdocs/quiz/inc/header.inc.php:
3) in /www13/htdocs/quiz/index.php on line 4
OK. I removed the header file and now it doesn't report anything.

-TJ

Jun 19 '07 #6
Rik
On Tue, 19 Jun 2007 21:47:46 +0200, te********@gmail.com
<te********@gmail.comwrote:
On Jun 19, 12:46 pm, "techjoh...@gmail.com" <techjoh...@gmail.com>
wrote:
>On Jun 19, 11:39 am, Rik <luiheidsgoe...@hotmail.comwrote:
On Tue, 19 Jun 2007 20:11:44 +0200, techjoh...@gmail.com
<techjoh...@gmail.comwrote:
On Jun 19, 10:59 am, Rik <luiheidsgoe...@hotmail.comwrote:
On Tue, 19 Jun 2007 19:18:02 +0200, techjoh...@gmail.com
><techjoh...@gmail.comwrote:
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:
>First rule of hunting errors: do not surpress any errors by @ if
something
isn't working.
>Second: I do not see any output, so as far as I'm concerned if
you've
>got
no errors you would still see nothing.
>- $qry['cat'] doesn't seem to be set anywhere, how come?
- check your queries for errors: echo mysql_error(), and the query
itself.
The entire page:
Well, that's nice, I do not spot any clear syntax errors.(That is, if
I
assume correctly that '// Check if scoreboard contains entries in this
category and, if so,list results' is on 1 single line) However, with
no
query result the only output would be '</ol><br />', which obviously
doesn't show up in a browser.
Wether there's a parse error in your other includes I couldn't say.
So, check your queries, echo mysql_error(), check mysql_num_rows() and
echo it to check wether the result has data or is empty, etc.
--
Rik Wasmus

Thanks.
echo mysql_error();

Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at /www13/htdocs/quiz/inc/header.inc.php:
3) in /www13/htdocs/quiz/index.php on line 4

OK. I removed the header file and now it doesn't report anything.
And how many rows in the dataset? Keep in mind I normally say different
things in a post, not just one.

--
Rik Wasmus
Jun 19 '07 #7
On Jun 19, 1:38 pm, Rik <luiheidsgoe...@hotmail.comwrote:
On Tue, 19 Jun 2007 21:47:46 +0200, techjoh...@gmail.com

<techjoh...@gmail.comwrote:
On Jun 19, 12:46 pm, "techjoh...@gmail.com" <techjoh...@gmail.com>
wrote:
On Jun 19, 11:39 am, Rik <luiheidsgoe...@hotmail.comwrote:
On Tue, 19 Jun 2007 20:11:44 +0200, techjoh...@gmail.com
<techjoh...@gmail.comwrote:
On Jun 19, 10:59 am, Rik <luiheidsgoe...@hotmail.comwrote:
>On Tue, 19 Jun 2007 19:18:02 +0200, techjoh...@gmail.com
><techjoh...@gmail.comwrote:
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:
>First rule of hunting errors: do not surpress any errors by @ if
>something
>isn't working.
>Second: I do not see any output, so as far as I'm concerned if
you've
>got
>no errors you would still see nothing.
>- $qry['cat'] doesn't seem to be set anywhere, how come?
>- check your queries for errors: echo mysql_error(), and the query
>itself.
The entire page:
Well, that's nice, I do not spot any clear syntax errors.(That is, if
I
assume correctly that '// Check if scoreboard contains entries in this
category and, if so,list results' is on 1 single line) However, with
no
query result the only output would be '</ol><br />', which obviously
doesn't show up in a browser.
Wether there's a parse error in your other includes I couldn't say.
So, check your queries, echo mysql_error(), check mysql_num_rows() and
echo it to check wether the result has data or is empty, etc.
--
Rik Wasmus
Thanks.
echo mysql_error();
Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at /www13/htdocs/quiz/inc/header.inc.php:
3) in /www13/htdocs/quiz/index.php on line 4
OK. I removed the header file and now it doesn't report anything.

And how many rows in the dataset? Keep in mind I normally say different
things in a post, not just one.

--
Rik Wasmus
Here is the mysql query:

DROP TABLE IF EXISTS questions;
CREATE TABLE questions (
ID int(4) unsigned zerofill NOT NULL auto_increment,
question text NOT NULL,
test varchar(31) NOT NULL default '',
ans1 text NOT NULL,
ans2 text NOT NULL,
ans3 text NOT NULL,
ans4 text NOT NULL,
ans5 text,
ans6 text,
corans varchar(8) NOT NULL default '',
expl text NOT NULL,
PRIMARY KEY (ID)
) TYPE=MyISAM;

DROP TABLE IF EXISTS subjects;
CREATE TABLE subjects (
ID int(4) unsigned zerofill NOT NULL auto_increment,
cat varchar(31) NOT NULL default '',
descr text NOT NULL,
random int(1) default NULL,
PRIMARY KEY (ID)
) TYPE=MyISAM;

Jun 19 '07 #8
Rik
On Tue, 19 Jun 2007 23:22:29 +0200, te********@gmail.com
<te********@gmail.comwrote:
On Jun 19, 1:38 pm, Rik <luiheidsgoe...@hotmail.comwrote:
>On Tue, 19 Jun 2007 21:47:46 +0200, techjoh...@gmail.com

<techjoh...@gmail.comwrote:
On Jun 19, 12:46 pm, "techjoh...@gmail.com" <techjoh...@gmail.com>
wrote:
On Jun 19, 11:39 am, Rik <luiheidsgoe...@hotmail.comwrote:
On Tue, 19 Jun 2007 20:11:44 +0200, techjoh...@gmail.com
<techjoh...@gmail.comwrote:
On Jun 19, 10:59 am, Rik <luiheidsgoe...@hotmail.comwrote:
On Tue, 19 Jun 2007 19:18:02 +0200, techjoh...@gmail.com
><techjoh...@gmail.comwrote:
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:
>First rule of hunting errors: do not surpress any errors by @if
something
isn't working.
>Second: I do not see any output, so as far as I'm concerned if
you've
got
no errors you would still see nothing.
>- $qry['cat'] doesn't seem to be set anywhere, how come?
- check your queries for errors: echo mysql_error(), and the
query
>itself.
The entire page:
Well, that's nice, I do not spot any clear syntax errors.(That is,
if
>I
assume correctly that '// Check if scoreboard contains entries in
this
category and, if so,list results' is on 1 single line) However,
with
>no
query result the only output would be '</ol><br />', which
obviously
doesn't show up in a browser.
Wether there's a parse error in your other includes I couldn't say.
So, check your queries, echo mysql_error(), check mysql_num_rows()
and
echo it to check wether the result has data or is empty, etc.
--
Rik Wasmus
>Thanks.
echo mysql_error();
>Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at
/www13/htdocs/quiz/inc/header.inc.php:
>3) in /www13/htdocs/quiz/index.php on line 4
OK. I removed the header file and now it doesn't report anything.

And how many rows in the dataset? Keep in mind I normally say different
things in a post, not just one.

Here is the mysql query:

DROP TABLE IF EXISTS questions;
CREATE TABLE questions (
ID int(4) unsigned zerofill NOT NULL auto_increment,
question text NOT NULL,
test varchar(31) NOT NULL default '',
ans1 text NOT NULL,
ans2 text NOT NULL,
ans3 text NOT NULL,
ans4 text NOT NULL,
ans5 text,
ans6 text,
corans varchar(8) NOT NULL default '',
expl text NOT NULL,
PRIMARY KEY (ID)
) TYPE=MyISAM;

DROP TABLE IF EXISTS subjects;
CREATE TABLE subjects (
ID int(4) unsigned zerofill NOT NULL auto_increment,
cat varchar(31) NOT NULL default '',
descr text NOT NULL,
random int(1) default NULL,
PRIMARY KEY (ID)
) TYPE=MyISAM;
I can clearly see that's not the query you are performing. Round 2, try
again. Still keep in mind the earlier remark that if the query has zero
rows it will not show you anything in a browser (unless you look at the
source).

--
Rik Wasmus
Jun 19 '07 #9
On Jun 19, 2:26 pm, Rik <luiheidsgoe...@hotmail.comwrote:
On Tue, 19 Jun 2007 23:22:29 +0200, techjoh...@gmail.com

<techjoh...@gmail.comwrote:
On Jun 19, 1:38 pm, Rik <luiheidsgoe...@hotmail.comwrote:
On Tue, 19 Jun 2007 21:47:46 +0200, techjoh...@gmail.com
<techjoh...@gmail.comwrote:
On Jun 19, 12:46 pm, "techjoh...@gmail.com" <techjoh...@gmail.com>
wrote:
On Jun 19, 11:39 am, Rik <luiheidsgoe...@hotmail.comwrote:
On Tue, 19 Jun 2007 20:11:44 +0200, techjoh...@gmail.com
<techjoh...@gmail.comwrote:
On Jun 19, 10:59 am, Rik <luiheidsgoe...@hotmail.comwrote:
>On Tue, 19 Jun 2007 19:18:02 +0200, techjoh...@gmail.com
><techjoh...@gmail.comwrote:
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:
>First rule of hunting errors: do not surpress any errors by @ if
>something
>isn't working.
>Second: I do not see any output, so as far as I'm concerned if
you've
>got
>no errors you would still see nothing.
>- $qry['cat'] doesn't seem to be set anywhere, how come?
>- check your queries for errors: echo mysql_error(), and the
query
>itself.
The entire page:
Well, that's nice, I do not spot any clear syntax errors.(That is,
if
I
assume correctly that '// Check if scoreboard contains entries in
this
category and, if so,list results' is on 1 single line) However,
with
no
query result the only output would be '</ol><br />', which
obviously
doesn't show up in a browser.
Wether there's a parse error in your other includes I couldn't say.
So, check your queries, echo mysql_error(), check mysql_num_rows()
and
echo it to check wether the result has data or is empty, etc.
--
Rik Wasmus
Thanks.
echo mysql_error();
Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at
/www13/htdocs/quiz/inc/header.inc.php:
3) in /www13/htdocs/quiz/index.php on line 4
OK. I removed the header file and now it doesn't report anything.
And how many rows in the dataset? Keep in mind I normally say different
things in a post, not just one.
Here is the mysql query:
DROP TABLE IF EXISTS questions;
CREATE TABLE questions (
ID int(4) unsigned zerofill NOT NULL auto_increment,
question text NOT NULL,
test varchar(31) NOT NULL default '',
ans1 text NOT NULL,
ans2 text NOT NULL,
ans3 text NOT NULL,
ans4 text NOT NULL,
ans5 text,
ans6 text,
corans varchar(8) NOT NULL default '',
expl text NOT NULL,
PRIMARY KEY (ID)
) TYPE=MyISAM;
DROP TABLE IF EXISTS subjects;
CREATE TABLE subjects (
ID int(4) unsigned zerofill NOT NULL auto_increment,
cat varchar(31) NOT NULL default '',
descr text NOT NULL,
random int(1) default NULL,
PRIMARY KEY (ID)
) TYPE=MyISAM;

I can clearly see that's not the query you are performing. Round 2, try
again. Still keep in mind the earlier remark that if the query has zero
rows it will not show you anything in a browser (unless you look at the
source).

--
Rik Wasmus
mysqlshow tables;
+----------------+
| Tables_in_quiz |
+----------------+
| questions |
| subjects |
+----------------+
2 rows in set (0.01 sec)

mysqlselect * from questions;
Empty set (0.00 sec)

mysqlselect * from subjects;
+------+---------+---------+--------+
| ID | cat | descr | random |
+------+---------+---------+--------+
| 0001 | TESTING | TESTING | 1 |
+------+---------+---------+--------+
1 row in set (0.00 sec)

Just a little more information.
Jun 19 '07 #10
Rik
On Wed, 20 Jun 2007 00:54:52 +0200, te********@gmail.com
<te********@gmail.comwrote:
On Jun 19, 2:26 pm, Rik <luiheidsgoe...@hotmail.comwrote:
>On Tue, 19 Jun 2007 23:22:29 +0200, techjoh...@gmail.com

<techjoh...@gmail.comwrote:
On Jun 19, 1:38 pm, Rik <luiheidsgoe...@hotmail.comwrote:
On Tue, 19 Jun 2007 21:47:46 +0200, techjoh...@gmail.com
><techjoh...@gmail.comwrote:
On Jun 19, 12:46 pm, "techjoh...@gmail.com" <techjoh...@gmail.com>
wrote:
On Jun 19, 11:39 am, Rik <luiheidsgoe...@hotmail.comwrote:
On Tue, 19 Jun 2007 20:11:44 +0200, techjoh...@gmail.com
<techjoh...@gmail.comwrote:
On Jun 19, 10:59 am, Rik <luiheidsgoe...@hotmail.comwrote:
On Tue, 19 Jun 2007 19:18:02 +0200, techjoh...@gmail.com
><techjoh...@gmail.comwrote:
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:
>First rule of hunting errors: do not surpress any errors by
@ if
>something
isn't working.
>Second: I do not see any output, so as far as I'm concerned
if
>you've
got
no errors you would still see nothing.
>- $qry['cat'] doesn't seem to be set anywhere, how come?
- check your queries for errors: echo mysql_error(), and the
query
itself.
The entire page:
Well, that's nice, I do not spot any clear syntax errors.(That
is,
>if
I
assume correctly that '// Check if scoreboard contains entries
in
>this
category and, if so,list results' is on 1 single line) However,
with
no
query result the only output would be '</ol><br />', which
obviously
doesn't show up in a browser.
Wether there's a parse error in your other includes I couldn't
say.
So, check your queries, echo mysql_error(), check
mysql_num_rows()
>and
echo it to check wether the result has data or is empty, etc.
--
Rik Wasmus
>Thanks.
echo mysql_error();
>Warning: session_start(): Cannot send session cache limiter -
headers
>already sent (output started at
/www13/htdocs/quiz/inc/header.inc.php:
3) in /www13/htdocs/quiz/index.php on line 4
OK. I removed the header file and now it doesn't report anything.
>And how many rows in the dataset? Keep in mind I normally say
different
>things in a post, not just one.
Here is the mysql query:
DROP TABLE IF EXISTS questions;
CREATE TABLE questions (
ID int(4) unsigned zerofill NOT NULL auto_increment,
question text NOT NULL,
test varchar(31) NOT NULL default '',
ans1 text NOT NULL,
ans2 text NOT NULL,
ans3 text NOT NULL,
ans4 text NOT NULL,
ans5 text,
ans6 text,
corans varchar(8) NOT NULL default '',
expl text NOT NULL,
PRIMARY KEY (ID)
) TYPE=MyISAM;
DROP TABLE IF EXISTS subjects;
CREATE TABLE subjects (
ID int(4) unsigned zerofill NOT NULL auto_increment,
cat varchar(31) NOT NULL default '',
descr text NOT NULL,
random int(1) default NULL,
PRIMARY KEY (ID)
) TYPE=MyISAM;

I can clearly see that's not the query you are performing. Round 2, try
again. Still keep in mind the earlier remark that if the query has zero
rows it will not show you anything in a browser (unless you look at the
source).

mysqlshow tables;
2 rows in set (0.01 sec)

mysqlselect * from questions;
Empty set (0.00 sec)

mysqlselect * from subjects;
1 row in set (0.00 sec)

Just a little more information.
Little droplets keep pouring in, I've got a feeling we're almost
there...:-). This offcourse is still not what I was asking, but it'll do:
no data in the resultsets, so no output, ergo no information screen.
Please fill you database, with junk if need be, but no data in it equals
no output from it I'd think.

--
Rik Wasmus
Jun 19 '07 #11
On Jun 19, 4:39 pm, Rik <luiheidsgoe...@hotmail.comwrote:
On Wed, 20 Jun 2007 00:54:52 +0200, techjoh...@gmail.com

<techjoh...@gmail.comwrote:
On Jun 19, 2:26 pm, Rik <luiheidsgoe...@hotmail.comwrote:
On Tue, 19 Jun 2007 23:22:29 +0200, techjoh...@gmail.com
<techjoh...@gmail.comwrote:
On Jun 19, 1:38 pm, Rik <luiheidsgoe...@hotmail.comwrote:
On Tue, 19 Jun 2007 21:47:46 +0200, techjoh...@gmail.com
<techjoh...@gmail.comwrote:
On Jun 19, 12:46 pm, "techjoh...@gmail.com" <techjoh...@gmail.com>
wrote:
On Jun 19, 11:39 am, Rik <luiheidsgoe...@hotmail.comwrote:
On Tue, 19 Jun 2007 20:11:44 +0200, techjoh...@gmail.com
<techjoh...@gmail.comwrote:
On Jun 19, 10:59 am, Rik <luiheidsgoe...@hotmail.comwrote:
>On Tue, 19 Jun 2007 19:18:02 +0200, techjoh...@gmail.com
><techjoh...@gmail.comwrote:
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:
>First rule of hunting errors: do not surpress any errors by
@ if
>something
>isn't working.
>Second: I do not see any output, so as far as I'm concerned
if
you've
>got
>no errors you would still see nothing.
>- $qry['cat'] doesn't seem to be set anywhere, how come?
>- check your queries for errors: echo mysql_error(), and the
query
>itself.
The entire page:
Well, that's nice, I do not spot any clear syntax errors.(That
is,
if
I
assume correctly that '// Check if scoreboard contains entries
in
this
category and, if so,list results' is on 1 single line) However,
with
no
query result the only output would be '</ol><br />', which
obviously
doesn't show up in a browser.
Wether there's a parse error in your other includes I couldn't
say.
So, check your queries, echo mysql_error(), check
mysql_num_rows()
and
echo it to check wether the result has data or is empty, etc.
--
Rik Wasmus
Thanks.
echo mysql_error();
Warning: session_start(): Cannot send session cache limiter -
headers
already sent (output started at
/www13/htdocs/quiz/inc/header.inc.php:
3) in /www13/htdocs/quiz/index.php on line 4
OK. I removed the header file and now it doesn't report anything.
And how many rows in the dataset? Keep in mind I normally say
different
things in a post, not just one.
Here is the mysql query:
DROP TABLE IF EXISTS questions;
CREATE TABLE questions (
ID int(4) unsigned zerofill NOT NULL auto_increment,
question text NOT NULL,
test varchar(31) NOT NULL default '',
ans1 text NOT NULL,
ans2 text NOT NULL,
ans3 text NOT NULL,
ans4 text NOT NULL,
ans5 text,
ans6 text,
corans varchar(8) NOT NULL default '',
expl text NOT NULL,
PRIMARY KEY (ID)
) TYPE=MyISAM;
DROP TABLE IF EXISTS subjects;
CREATE TABLE subjects (
ID int(4) unsigned zerofill NOT NULL auto_increment,
cat varchar(31) NOT NULL default '',
descr text NOT NULL,
random int(1) default NULL,
PRIMARY KEY (ID)
) TYPE=MyISAM;
I can clearly see that's not the query you are performing. Round 2, try
again. Still keep in mind the earlier remark that if the query has zero
rows it will not show you anything in a browser (unless you look at the
source).
mysqlshow tables;
2 rows in set (0.01 sec)
mysqlselect * from questions;
Empty set (0.00 sec)
mysqlselect * from subjects;
1 row in set (0.00 sec)
Just a little more information.

Little droplets keep pouring in, I've got a feeling we're almost
there...:-). This offcourse is still not what I was asking, but it'll do:
no data in the resultsets, so no output, ergo no information screen.
Please fill you database, with junk if need be, but no data in it equals
no output from it I'd think.

--
Rik Wasmus
Thanks for all your time. I'm closing this issue, because it's now
working.

There's a good chance this was working all along. Since the questions
were failing to populated, the page wasn't displaying the subjects.

Lack of awareness is my problem.

--TJ

Jun 20 '07 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: dmcconkey | last post by:
Hi folks, I have a client with four websites. Each site has a contact form that is identical. They all have "required" fields validated through a JavaScript onSubmit() function. Upon validation,...
2
by: Ravi | last post by:
I have a webpage(with a text field and a button) which prompts for a local file and attempts to load the file in the window if the user clicks on the button. The javascript code onClick event uses...
2
by: Michael | last post by:
All, I have a form send a variable to another page. Based on the variable the page will show a different image. I.E. <form METHOD="POST" ACTION="http://mysite.com/photo.htm"> <input...
14
by: charlie_M | last post by:
Is there a way to blank the screen in a FORM's onsubmit=... to blank the screen for the user?? I asked this before and got a way to blank a table by id with ...
6
by: Melissa | last post by:
Does anyone have a generic procedure for adding blank lines to reports like Sales details, PO details and/or Orders details. The procedure would need to count the number of line items, determine...
4
by: Nhmiller | last post by:
Access seems to always generate a second page, which is blank, to my one page report. How do I delete the second page? Thanks. Neil Cat Paintings At Carol Wilson Gallery...
6
by: noway | last post by:
I have greated a report and have included a page break in it. The report breaks were it is supposed to but then it creates a blank page between the two pages. Since this report will print out...
3
by: Wayne | last post by:
I have a report containing 2 subreports. The subreports each contain a chart. The whole thing easily fits on one page but a second blank page is consistently being generated. This has nothing...
1
by: siomay87 | last post by:
please help i have a problem in the ms access reporting, my report have: page header, detail, page footer and report footer In listing "detail section", the number of line is depend on the data...
4
by: sid | last post by:
"about:blank" oepns new browser window I am writing a webpage that will run on other machines that I may or may not know about. My page is framed where frame1 controls the content of frame2. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.