473,386 Members | 1,706 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,386 software developers and data experts.

mysql_fetch_row --> error! Help please!

Hi there,

I am using some example PHP code to build a counter for a page on my
webserver.
When going to that page, I will see the following error message:

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in C:\Program Files\Apache Group\Apache2\htdocs\test\test.php on
line 33

And line33 shows as follows:

for ($count = 1; $row = mysql_fetch_row($result); ++$count)

What did I do wrong here?

gr.,
Stefan.
Jul 17 '05 #1
4 2761
Stefan van Roosmalen wrote:
Hi there,

I am using some example PHP code to build a counter for a page on my
webserver.
When going to that page, I will see the following error message:

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in C:\Program Files\Apache Group\Apache2\htdocs\test\test.php on
line 33

And line33 shows as follows:

for ($count = 1; $row = mysql_fetch_row($result); ++$count)

What did I do wrong here?

gr.,
Stefan.


hi there,

add between your for-loop and your query execution (mysql_query()) a
line like:

print(mysql_error());

the given error message assumes that something went wrong with your
database query. it did not return a result thus not being valid for
mysql_fetch_row.

regards,
stefan ;-)

--
"The goal of Computer Science is to build something that will last at
least until we've finished building it." -- unknown
Jul 17 '05 #2
*** Stefan van Roosmalen escribió/wrote (Sun, 12 Sep 2004 12:09:42 +0200):
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in C:\Program Files\Apache Group\Apache2\htdocs\test\test.php on
line 33

And line33 shows as follows:

for ($count = 1; $row = mysql_fetch_row($result); ++$count)

What did I do wrong here?


You apparently don't do error checking in a previous mysql_query().
There're many ways, one of them is:

$result=@mysql_query($query)
or die(mysql_error());

--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Las dudas informáticas recibidas por correo irán directas a la papelera
-+ I'm not a free help desk, please don't e-mail me your questions
--
Jul 17 '05 #3
Stefan van Roosmalen wrote:
Hi there,


STOP MULTIPOSTING! (same message in alt.php)
JW

Jul 17 '05 #4
It's working now.

I was not using the right username/password, that's why my first SQL
statement went wrong!

Thank you all.

gr.,
Stefan.

"Stefan van Roosmalen" <ro******@planet.nl> wrote in message
news:ci**********@reader13.wxs.nl...
Hi there,

I am using some example PHP code to build a counter for a page on my
webserver.
When going to that page, I will see the following error message:

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in C:\Program Files\Apache Group\Apache2\htdocs\test\test.php on
line 33

And line33 shows as follows:

for ($count = 1; $row = mysql_fetch_row($result); ++$count)

What did I do wrong here?

gr.,
Stefan.

Jul 17 '05 #5

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

Similar topics

14
by: tasheeta | last post by:
In my simple program I am getting this error..please help I am trying to find integers where 65537i + 3551j = 1 error: cannot convert `__complex__ int' to `long int' in assignment ...
2
by: Andrew Ayers | last post by:
All, I am having a problem with an INSERT onto a table I have created. First off, here is the table: --- CREATE TABLE reg ("customer number" SERIAL PRIMARY KEY, "company name" ...
2
by: S.K. Dutta | last post by:
Hi! I am having a problem that I do not have any clue on what to do. I have tries a few obvious things... <system.diagnostics> in the main web.config file is giving configuration error on a...
11
by: Wolfgang Kaml | last post by:
I am not sure if this is more of an expert question, but I am sure that they are out there. I'd like to setup a general application or bin directory on my Win2003.Net Server that will hold some...
5
by: Savas Ates | last post by:
I have a web application It works well in my local folder.. When i upload it to my web server i got To enable the details of this specific error message to be viewable on remote machines,...
3
by: Monty | last post by:
OK, I had an issue with this and found lots of advice that did not apply, so I'm posting what I found hoping it might help someone else. Here's the sitch: you have a COM app that calls to a .Net...
0
by: venugopalsripada | last post by:
Hi, I use imaplib to download emails from my AOL accounts. I have 6 accounts. I am recieving ('NO', ) as a return value for search(None, 'ALL') for one of the accounts while all other acocunts are...
2
by: keethyanandpr | last post by:
Hi, This is the error I get when I try to download a file from Rapidshare. ERROR: Please enable JavaScript. I uninstalled and reinstalled Sun JDK 6.0. Sill the problem persists. The problem...
0
by: smtwtfs007 | last post by:
Any body has any idea about his error please? I got this error at the time of creating crystal report. I tried everything to resolve this error. But I could not. Please help. Exception has...
3
by: YaoBao | last post by:
In my main page, I use <cfinclude> tag to include my header and footer. But I get error. "Context validation error for the cfif tag. The start tag must have a matching end tag. An explicit end...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
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
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
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
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,...
0
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...
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,...

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.