MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old July 29th, 2004, 06:12 PM
tim_ver tim_ver is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 7 tim_ver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
mysql_fetch_array(): supplied argument error

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

The line of code is: $copy = mysql_fetch_array($return);


How do I fix this?

Thanks

Reply With Quote
  #2  
Old July 29th, 2004, 09:08 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Try applying the fix I gave you in the other thread. If that doesn't work, you can always try passing your database resource variable (what's returned when you call mysql_connect()) as the second parameter.
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
  #3  
Old July 29th, 2004, 09:52 PM
tim_ver tim_ver is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 7 tim_ver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
changed it...

i did this


$meta_row = @mysql_fetch_array($meta_return);

it went away. Is this a fix or a band aid?

Thanks

Reply With Quote
  #4  
Old July 30th, 2004, 07:14 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
I think the actual fix is to make sure you supply the database resource as the second parameter, as noted above. It's obviously always better to apply a fix than simply to force suppression of a warning that could otherwise be fixed correctly. That said, you can often use the @ syntax along with die statements to catch actual function failures without running into any major problems.

Reply With Quote
  #5  
Old July 30th, 2004, 10:39 AM
tim_ver tim_ver is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 7 tim_ver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Ok

Ok, so since this went away all it seems to be working fine now I should be ok or should I dig deeper to

find the issue?

Thanks

Reply With Quote
  #6  
Old July 30th, 2004, 10:51 AM
kode_monkey kode_monkey is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 367 kode_monkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 21 sec
Reputation Power: 5
In my opinion it is always worth digging deeper until you understand what actually caused a problem. Its far better to spend some extra time on something when the pressure isn't on than to ignore it and be caught out later when you might not have the time.

-KM-

Reply With Quote
  #7  
Old July 30th, 2004, 03:08 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
I agree with KM. Better to fix the code and get into a habit of writing it the fixed way. Decreases the likelihood that you'll get hit by this in the future.

Reply With Quote
  #8  
Old July 30th, 2004, 06:01 PM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 4 m 48 sec
Reputation Power: 8
Does adding the @ fix the problem, or just make the error go away?
Meaning, is your database still returning the desired results?

Adding the @ simply tells PHP to ignore the line if it causes an error.

I'd recommend checking your results to ensure it's functioning properly.

And I agree with kode_monkey and dhouston in the matter of fixing problems is better than doing a half-fast job at making the problem disappear.

Reply With Quote
  #9  
Old July 30th, 2004, 10:37 PM
tim_ver tim_ver is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 7 tim_ver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
checked it.

I did check more into it and all seems fine with the db now.

Looks like the line of code was not needed.

Thanks much.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > mysql_fetch_array(): supplied argument error


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway