Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Eudemons Online > EO PServer Hosting
You last visited: Today at 13:32

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Web error] Expects paramater 1 to be resource

Discussion on [Web error] Expects paramater 1 to be resource within the EO PServer Hosting forum part of the Eudemons Online category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2009
Posts: 136
Received Thanks: 13
[Web error] Expects paramater 1 to be resource

I am getting this error
Code:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\pages\nobility.php on line 15
any ideas?
KiiDxLaggy is offline  
Old 04/23/2011, 06:47   #2
 
Eurion's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 1,208
Received Thanks: 926
Can you post lines 10 - 20 of your nobility.php file please.
Eurion is offline  
Thanks
1 User
Old 04/23/2011, 06:52   #3
 
elite*gold: 0
Join Date: Jul 2009
Posts: 136
Received Thanks: 13
Quote:
Originally Posted by Eurion View Post
Can you post lines 10 - 20 of your nobility.php file please.

Code:
		<h1>Nobility Ranking</h1>

<table width="100%" border="0">
    <tr>
  <th width="20%" align="center"><b>Rank</b></th>
  <th width="20%" align="center"><b>User name</b></th>
  <th width="20%" align="center"><b>Gold Donated</b></th>
    </tr>
<h2></h2>
<?php

    $rank = mysql_query("SELECT * FROM cq_donation_dynasort_rec ORDER by value desc limit 20");
    //$row = mysql_fetch_array($rank);
    $i=1;
    while($row = mysql_fetch_array($rank)){
    echo '
    <td><div align="center">'.$i.'-</td></div>
    <td><div align="center">'.$row['user_name'].'</td></div>
    <td><div align="center">'.$row['value'].'</td></div>
   </tr> ';
  $i=$i+1;
    }

?></tr>
</table>
That is the whole file. This error is also happening in all the other pages that require mySQL also. I am using a website that Elite4Demons released, heres my site if you wanna see what im talking about:
HTML Code:
http://nextgengaming.no-ip.org
KiiDxLaggy is offline  
Old 04/23/2011, 07:06   #4
 
Eurion's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 1,208
Received Thanks: 926
Are you sure, that your mysql is working correctly? I've tested that code, and there's nothing missing in it.

Looked at your source. It seems like your php is set so it doesnt load ASP like tags. To fix this, just edit your codes so that all your php tags are changed from like:

Code:
<? 

require("config.php");

?>
to
Code:
<?php 

require("config.php");

?>
Eurion is offline  
Thanks
1 User
Old 04/23/2011, 07:11   #5
 
elite*gold: 0
Join Date: Jul 2009
Posts: 136
Received Thanks: 13
Yah pretty sure.. I just it and it works fine, i can connect to navicat and all, uhm.. I added you on MSN maybe this would be easier if you try to help on there? I wont bug you >.>
KiiDxLaggy is offline  
Old 04/23/2011, 07:18   #6

 
PowerChaos's Avatar
 
elite*gold: 90
Join Date: Feb 2008
Posts: 1,114
Received Thanks: 640
Quote:
Originally Posted by KiiDxLaggy View Post
I am getting this error
Code:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\pages\nobility.php on line 15
any ideas?
as far as the text says

it dit not return a valid result or it is called muliple times

more info can be found on the quotes i took from other forums

Quote:
Originally Posted by a other forum
deMorte - 12:59 pm on Jul 22, 2008 (gmt 0)


Where are you calling the function numrows()?
The error code states that you are sending a boolean to the function and you should be sending a mysql resource. This resource comes from a valid mysql query.
Maybe the sql query you are making is not valid and produces a FALSE boolean and then you are trying to send this boolean to the numrows() function.
Quote:
Originally Posted by other post from a forum
eelixduppy - 4:45 am on Jul 23, 2008 (gmt 0)


It means that wherever you are calling the function numrows($var) the $var isn't a valid argument. It should be the result from mysqli_query. The code that you have given us is correct. You are calling the function numrows somewhere else in your code and that is what is creating the error.
Greets From PowerChaos
PowerChaos is offline  
Old 04/23/2011, 07:29   #7
 
Eurion's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 1,208
Received Thanks: 926
None of those are correct. His issue was that the site uses the ASP type opening tags such as <? instead of the typical <?php . When changed it worked as planned.
Eurion is offline  
Thanks
1 User
Old 04/23/2011, 07:59   #8
 
elite*gold: 0
Join Date: Jul 2009
Posts: 136
Received Thanks: 13
Quote:
Originally Posted by Eurion View Post
Are you sure, that your mysql is working correctly? I've tested that code, and there's nothing missing in it.

Looked at your source. It seems like your php is set so it doesnt load ASP like tags. To fix this, just edit your codes so that all your php tags are changed from like:

Code:
<? 

require("config.php");

?>
to
Code:
<?php 

require("config.php");

?>
This was the problem! thanks.
KiiDxLaggy is offline  
Old 04/23/2011, 17:00   #9

 
PowerChaos's Avatar
 
elite*gold: 90
Join Date: Feb 2008
Posts: 1,114
Received Thanks: 640
i am basicly wondering what asp tags has to do with boolean

if i am not wrong
if you use short tags when not supported then php does not get executed ??
maybe that can return that error as it is expecting a value but can not get a value as it does not get executed ??

anyway
i am happy that the problem is solved

Greets From PowerChaos
PowerChaos is offline  
Old 04/23/2011, 17:18   #10
 
Eurion's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 1,208
Received Thanks: 926
Quote:
Originally Posted by PowerChaos View Post
i am basicly wondering what asp tags has to do with boolean

if i am not wrong
if you use short tags when not supported then php does not get executed ??
maybe that can return that error as it is expecting a value but can not get a value as it does not get executed ??

anyway
i am happy that the problem is solved

Greets From PowerChaos
Without the ASP tags turned on, the php will not compile the code and spit it out. So in his case, it wasn't loading his config.php file.

The "resource" error was caused because the mysql connection was included inside his config.php file which wasn't being read.
Eurion is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
error con el s4 resource
01/10/2010 - S4 League - 8 Replies
le doy a importar y me pone algo en inglés y al final me pone: El sistema no puede hallar el archivo especificado alguien me ayuda?? :S
Resource Tool error
01/06/2010 - S4 League - 7 Replies
hi.. i got the resource tool but when i click on "decrypt" it shows me an error. Edit: no problem anymore can someone help me pls? i tryed to reinstall the game etc. but the same problem shows still up
error in the resource tool HELP
12/31/2009 - S4 League - 14 Replies
hello again I'm pinguinacs once again taking his patience this happens then we received an error in s4 resource I need help http://img707.imageshack.us/img707/4768/errorw.jp g how to solve??
S4 Resource Bikini error D:
12/31/2009 - S4 League - 3 Replies
when i do the codes for the bikini my characters body is invisble can anyone give me the correct codes or tell me by step to fix this problem!!
s4 resource error
12/31/2009 - S4 League - 2 Replies
i get this error when i change my subs into vital shock D:



All times are GMT +2. The time now is 13:32.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.