473,802 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\h tdocs\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 2777
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\h tdocs\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_err or());

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\h tdocs\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******@plane t.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\h tdocs\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
2180
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 #include <iostream> #include <complex>
2
2053
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" VARCHAR(50) NULL, address VARCHAR(100) NULL, city VARCHAR(50) NULL, state VARCHAR(2) NULL, zip VARCHAR(50) NULL, phone VARCHAR(50) NULL,
2
3633
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 particular machine that has both version of vs.net installed (v1.0.3705 and v1.1.4322).
11
3143
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 useful utils that more pages on that server can use. As an example, I have created a Page Counter class that opens an Access .mdb file, counts the current entries for that page, and adds a new entry with some information regarding the current...
5
2008
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, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
3
2103
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 assembly which in turn calls a web service. You know the web service is reachable and that the COM app is able to instantiate your .Net assembly (because you RegAsm'ed it and it's good to go). However, when you attempt to make a call to the web...
0
1650
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 working properly. I contacted AOL support and they confirmed that the error message is not generated by AOL. Where could the problem would be? I can confirm that there are no changes in the settings. Thanks, Venu
2
10501
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 is generic now. For instance I cannot use the collapse / expnad links at the top of this post. I have also enabled all scritping options in my browser (IE 7.0).
0
1276
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 been thrown by the target of an invocation. at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean...
3
4079
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 tag can be provided by adding </cfif>. If the body of the tag is empty, you can use the shortcut <cfif .../>. " If I put the three files into one big file without using <cfinclde> tag, the page display with no error. Here is my code: ...
0
10538
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
10305
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...
1
10285
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10063
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9115
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
7598
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
6838
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();...
1
4270
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
2
3792
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.