473,699 Members | 2,905 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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('i nc/db_config.inc.p hp');
$conn = db_connect();

if (isset($HTTP_SE SSION_VARS['scoreboard'])) {
echo '<p id="hornav"><a href="results.p hp">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($sq lsu, $conn);
line 21 if (mysql_num_rows ($ressu)) {

Jun 15 '07 #1
2 16924
On Jun 15, 7:27 pm, "techjoh...@gma il.com" <techjoh...@gma il.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('i nc/db_config.inc.p hp');
$conn = db_connect();

if (isset($HTTP_SE SSION_VARS['scoreboard'])) {
echo '<p id="hornav"><a href="results.p hp">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($sq lsu, $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.ph p ?

Jun 16 '07 #2
te********@gmai l.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('i nc/db_config.inc.p hp');
$conn = db_connect();

if (isset($HTTP_SE SSION_VARS['scoreboard'])) {
echo '<p id="hornav"><a href="results.p hp">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($sq lsu, $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*******@attgl obal.net
=============== ===
Jun 16 '07 #3

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

Similar topics

3
3911
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"> <div class="boxhead" style="text-align:center;"> <strong>Menu</strong> </div> <br /> <?php require ('includes/db_conn.inc.php'); $query = "select * from menu order by item_order"; $result = mysql_query($query);
1
2095
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 error on this code below: <html> <head> <titleColorado</title>
4
7832
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 fields Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/themepar/public_html/changepass.php on line 34 Sorry You failed to enter the correct old password I was wondering if anyone could help me, I have...
1
2705
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 line 113 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/mamadele/public_html/BESTPLAYS/search.php on line 127 My code is below. Any help would be much appreciated. ...
11
3592
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 when there is no result "empty table" how can i do a quick fix to say No Results... row 88: if ($myrow = mysql_fetch_array($result)) { do { if ($rowcolor == 1) {
2
10285
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 D:\Public_Site\multifileupload\welcome_addfiles.php on line 28 ------------------------------------------------------------ i am trying many ways by giving diff arguments in fread() --------------------------------------------------- suggest me , wat error...
4
5026
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 check login details. Here is the code for the pages that i used. main_login.php <html> <body>
1
1930
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? Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/xxxx/public_html/propview.php on line 78 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in...
10
3110
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 unfortunately I have made little sense of some of the solutions that have been posted. I have looked into it and now have some understanding of what the code should be doing or what it is trying to do. The error is
0
8704
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8623
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9192
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9054
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7781
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4390
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2362
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.