473,396 Members | 1,895 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,396 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 16884
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.