472,378 Members | 1,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

PHP Error message: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/jplane/certcent/phpweb/quiz/index.php on line 20

Error:

Warning: mysql_query(): supplied argument is not a valid MySQL-Link
resource in /home/jplane/certcent/phpweb/quiz/index.php on line 20

Warning: mysql_num_rows(): supplied argument is not a valid MySQL
result resource in /home/jplane/certcent/phpweb/quiz/index.php on line
21

PHP CODE:

session_start();
require_once('inc/db_config.inc.php');
$conn = db_connect();

if (isset($HTTP_SESSION_VARS['scoreboard'])) {
echo '<p id="hornav"><a href="results.php">View Results Sheet</a></
p>';
}
?>
<h2>Welcome to the Test Zone</h2>
<h3>Please select a subject area and the number of questions you wish
to answer.</h3>
<ol id="numbered">
<?php
$sqlsu = "SELECT * FROM subjects ORDER BY ID";
line 20 $ressu = mysql_query($sqlsu, $conn);
line 21 if (mysql_num_rows($ressu)) {

Jun 15 '07 #1
2 16761
On Jun 15, 7:27 pm, "techjoh...@gmail.com" <techjoh...@gmail.com>
wrote:
Error:

Warning: mysql_query(): supplied argument is not a valid MySQL-Link
resource in /home/jplane/certcent/phpweb/quiz/index.php on line 20

Warning: mysql_num_rows(): supplied argument is not a valid MySQL
result resource in /home/jplane/certcent/phpweb/quiz/index.php on line
21

PHP CODE:

session_start();
require_once('inc/db_config.inc.php');
$conn = db_connect();

if (isset($HTTP_SESSION_VARS['scoreboard'])) {
echo '<p id="hornav"><a href="results.php">View Results Sheet</a></
p>';}

?>
<h2>Welcome to the Test Zone</h2>
<h3>Please select a subject area and the number of questions you wish
to answer.</h3>
<ol id="numbered">
<?php
$sqlsu = "SELECT * FROM subjects ORDER BY ID";
line 20 $ressu = mysql_query($sqlsu, $conn);
line 21 if (mysql_num_rows($ressu)) {
The message means you aren't connected to the database -- or, more
specifically, that $conn is not a valid connection resource.

What's in inc/db_config.db.php ?

Jun 16 '07 #2
te********@gmail.com wrote:
Error:

Warning: mysql_query(): supplied argument is not a valid MySQL-Link
resource in /home/jplane/certcent/phpweb/quiz/index.php on line 20

Warning: mysql_num_rows(): supplied argument is not a valid MySQL
result resource in /home/jplane/certcent/phpweb/quiz/index.php on line
21

PHP CODE:

session_start();
require_once('inc/db_config.inc.php');
$conn = db_connect();

if (isset($HTTP_SESSION_VARS['scoreboard'])) {
echo '<p id="hornav"><a href="results.php">View Results Sheet</a></
p>';
}
?>
<h2>Welcome to the Test Zone</h2>
<h3>Please select a subject area and the number of questions you wish
to answer.</h3>
<ol id="numbered">
<?php
$sqlsu = "SELECT * FROM subjects ORDER BY ID";
line 20 $ressu = mysql_query($sqlsu, $conn);
line 21 if (mysql_num_rows($ressu)) {
Check the result from mysql_query. You'll find it returned false,
probably because of a proboem with the select statement.

Also see mysql_error() in the doc to help you diagnose your error.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 16 '07 #3

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

Similar topics

3
by: petemaxi | last post by:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Program Files\xampp\htdocs\tockholes\includes\menu.inc.php on line 9 <div class="left"> <div class="menu">...
1
by: myaashik | last post by:
Hello! All I have a Error message saying that: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/rocks/public_html/colorado3.php on line 32 I have...
4
by: Ryanlawrence1 | last post by:
Heya, I get these 2 errors: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/themepar/public_html/changepass.php on line 20 You have not entered all the...
1
by: lsmamadele | last post by:
I am getting the following error messages in my search: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/mamadele/public_html/BESTPLAYS/search.php on...
11
by: Breana | last post by:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/breana/public_html/category.php on line 88 ------------------------------------------- It does this...
2
by: yogitha | last post by:
For the below code i am getting an error like : --------------------------------------------------------------- Warning: fread(): supplied argument is not a valid stream resource in...
4
by: fisherd | last post by:
When i run this code, i keep getting this message; Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\wamp\www\checklogin.php on line 26 i use this code to...
1
by: kmacc | last post by:
Hi, I'm getting this error on a page after changing server host, the error did not happen on my old host. I'm thinking it is to do with a new MySQL version and more strict coding. Can anyone help?...
10
wilsonh
by: wilsonh | last post by:
Hi I am aware that this is a common problem as I have scoured the internet endlessly looking for a solution. The script was installed and set up for me because I am a complete beginner so...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

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.