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

mysql_fetch_array(): supplied argument is not a valid MySQL result resource

I was working with OOP, and was testing a sql result class, but it gives me the following error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource. I think it has to do with assignment or garbage collection
Expand|Select|Wrap|Line Numbers
  1. $con = MYSQLconn();
  2. $res = DSQL::PSQL('SELECT * FROM cat_nav',$con);
  3. $res2 = DSQL::PSQL('SELECT * FROM cat_nav',$con);
  4. $superres = new SQLResult($res2, $con);
  5. while ($ar = Get($res))
  6. {
  7.     print_r($ar);
  8. }
  9. echo "end";
  10. while ($ar = $superres->Get())
  11. {
  12.     print_r($ar);
  13.  
  14. }
  15. function Get($rs)
  16. {
  17.     return mysql_fetch_array($rs);//no error here
  18. }
  19. class SQLResult
  20. {
  21.     private $innerResult;
  22.     public function __contruct($sqlresult)
  23.     {
  24.         $this->$innerResult = $sqlresult;
  25.     }
  26.     public function Get()
  27.     {
  28.         return mysql_fetch_array($this->innerResult);//Error here
  29.     }
  30.  
  31. }
Apr 19 '09 #1
1 2140
Found the error, I called the constructor __contruct instead of __construct
Apr 19 '09 #2

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

Similar topics

4
by: josh dismukes | last post by:
i recieve this error from this part of the code: mysql_fetch_array(): supplied argument is not a valid mysql result resource it's returning a long text from the database which is about 200...
2
by: wrw[three] | last post by:
Hey Okay so i have a page that lists a bunch of clients... then another page that would limit it to a specific chosen client.... the one that lists all the clients is working just fine, however...
3
by: Pratchaya | last post by:
Hi Everyone ============================================================== About PHP::: Error/Problem PHP Warning: mysql_fetch_array():...
1
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...
3
by: dslade | last post by:
I got the following message when trying to do a mysql php query: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\Apache Group\Apa.... ...
1
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...
11
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...
11
by: chemlight | last post by:
I'm having a problem. I'm sure I'm going to kick myself over the answer... I have a table that stores vendors and their languages. This table starts out blank. I am querying the table to see if a...
1
mideastgirl
by: mideastgirl | last post by:
What does this error mean? Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/content/m/i/d/mideasthonors/html/student_session_proposal_success.php on...
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: 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
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...
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
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
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...
0
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...
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.