|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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. |
|
#3
|
|||
|
|||
|
changed it...
i did this
$meta_row = @mysql_fetch_array($meta_return); it went away. Is this a fix or a band aid? Thanks |
|
#4
|
||||
|
||||
|
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.
|
|
#5
|
|||
|
|||
|
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 |
|
#6
|
|||
|
|||
|
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- |
|
#7
|
||||
|
||||
|
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.
|
|
#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. |
|
#9
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > mysql_fetch_array(): supplied argument error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|