473,403 Members | 2,183 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,403 software developers and data experts.

Weird message, pops up once in a while why?

117 100+
Ok, this is weird but i get this message every so often and i have no clue why icheck all seems ok.
[PHP]
faultCode0faultStringWarning:mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/vol1000/if_897174/gamehackers.ifastnet.com/htdocs/rheader.php on line 34faultCode0faultStringWarning:mysql_free_result() : supplied argument is not a valid MySQL result resource in /home/vol1000/if_897174/gamehackers.ifastnet.com/htdocs/rheader.php on line 35[/PHP]
Sep 7 '07 #1
4 1223
Atli
5,058 Expert 4TB
Hi Breana.

That happens when you try to read rows from a mysql result created by a query that failed. When a query fails the query function returns false, rather than a MySQL result.

Try checking whether the result is valid before you try to fetch the rows.
That is as simple as this:
Expand|Select|Wrap|Line Numbers
  1. if(!$result) {
  2.   die("MySQL query failed! OMG!");
  3. }
  4.  
Alternatively, if the fact that your query is failing does not have any negative side effects on your code, you can add an at sign (@) in front of the mysq_fetch_row function to silence the warning.
Sep 7 '07 #2
Breana
117 100+
Ok, this is the code at line 33.

$_res = mysql_query($_sql);

so i can do this:

$_res = @ mysql_query($_sql); to kill the warning?
Shoulding i fix it to make it work right :)

And this is the other error i forgot to post. i cant find it anywhere.

[PHP]faultCode0faultStringWarning:include(templates.cla ss.php) [function.include]: failed to open stream: No such file or directory in /home/vol1000/if_897174/gamehackers.ifastnet.com/htdocs/index.php on line 3faultCode0faultStringWarning:include() [function.include]: Failed opening 'templates.class.php' for inclusion (include_path='.:/usr/share/php:/tmp') in /home/vol1000/if_897174/gamehackers.ifastnet.com/htdocs/index.php on line 3[/PHP]

I looked over my index.php 50 time i never put that code so why does it pop up?
And thanx for the reply i don't want to be rude :P
Sep 8 '07 #3
Atli
5,058 Expert 4TB
Ok, this is the code at line 33.

$_res = mysql_query($_sql);

so i can do this:

$_res = @ mysql_query($_sql); to kill the warning?
Shoulding i fix it to make it work right :)
Yea, you can add @ in front of most functions to suppress warnings.
Note that warnings are only printed if error_reporting is turned on.

Although, it is better to structure the code so that you do not need to suppress to many warnings.
For example, this won't require any suppressing:
Expand|Select|Wrap|Line Numbers
  1. $result = mysql_query("SHOW TABLES") 
  2.             or die("Query failed: ". mysql_error());
  3.  
  4. if($result) {
  5.   // Print data
  6.   echo "<pre>";
  7.   while($row = mysql_fetch_assoc($result)) {
  8.     $rowNum++;
  9.     echo "\n<b>$rowNum</b>";
  10.     foreach($row as $colName => $colValue) {
  11.       echo "\n - $colName = $colValue";
  12.     }
  13.   }
  14.   echo "</pre>";
  15.  
  16.   // Free result
  17.   mysql_free_result($result);
  18. }
  19. else {
  20.   echo "Query failed!";
  21. }
  22.  
  23.  
And this is the other error i forgot to post. i cant find it anywhere.

[PHP]faultCode0faultStringWarning:include(templates.cla ss.php) [function.include]: failed to open stream: No such file or directory in /home/vol1000/if_897174/gamehackers.ifastnet.com/htdocs/index.php on line 3faultCode0faultStringWarning:include() [function.include]: Failed opening 'templates.class.php' for inclusion (include_path='.:/usr/share/php:/tmp') in /home/vol1000/if_897174/gamehackers.ifastnet.com/htdocs/index.php on line 3[/PHP]

I looked over my index.php 50 time i never put that code so why does it pop up?
And thanx for the reply i don't want to be rude :P
It's not there?
Is it possible that your server has an old version of the file?

If the include line is not in line 3 of the index.php file, what is?
Sep 8 '07 #4
Breana
117 100+
Line 3 of the php is text.

echo ("Welcome guest, please login!");

Well i uploaded the file again and cleared the cashe files and i will just have to see if it ever pops up again hope not.
Sep 8 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: jwbeaty | last post by:
Here's a weird one. I'm running SQL Server 7 and when I run a backup something weird happens. When I perform the backup via Enterprise Manager by right clicking on the database I want to...
2
by: surjs | last post by:
Hi I'm wanting some help on how to create a message that automatically pops up on opening an access form, that says for example ' Remember to ......'. I've been able to this by assigning a...
3
by: Val | last post by:
In vc7 (studio 2002), when I try to debug the first "if" statement, the IDE jumps to the next valid line and evaluates it even if the if-statement is false. What is going on? if(...
2
by: Albert Pascual | last post by:
I always see this error when accesing any page in website I compiled in ASP.NET Compiler Error Message: CS0433: The type 'Customer_CreditWizard' exists in both...
2
by: Stephan Zaubzer | last post by:
Hi all, I encountered a problem with NumericUpDown yesterday and managed to reproduce the error with a very easy examle. I have a Windows Application with only one Form, which contains only one...
2
by: Mehmet Kitapci | last post by:
Hi, I receive this "Debug Error!" message while deleting the CContext instance. e.g. CContext pCC = new CContext(); // ... do something on pCC delete pCC; // error message pops up...
6
by: kwest | last post by:
I just setup a new server with PHP 5 and ran into a problem with includes. Everytime I call something like require_once './includes/test.inc' I get a permissions message like this: Warning:...
3
by: modermo | last post by:
Hey new to javascript figuring out how to fix this darn problem. I employ an image rollover, and it works beautifully in safari. But in firefox, the image has an annoying blue border around...
4
by: =?Utf-8?B?SmVzcGVyLCBEZW5tYXJr?= | last post by:
Hi, On a simple form, I have a ListBox control. This listbox control is loaded with around 800 text items of somewhat short length. There are also some other controls on the form, buttons. When...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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,...
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.