473,732 Members | 2,196 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 16929
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
3914
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
2096
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
7834
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
2709
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
3597
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
10288
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
5029
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
1933
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
3112
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
8774
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
9447
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
8186
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...
1
6735
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
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
4550
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
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.