I've attached the part of the code that seems to be going wrong.
Any help would be appreciated.
It's all correct. The intended result occurs... but it still comes up with this error. Could it be because there is another query before this part of the code that also uses the fetch assoc?
Well, you're changing the value of $result while you're still using it in the loop. Perhaps using more informative variable names would help avoid the risk of trying to use the same one for two different things at the same time.
Thats it! Thanks heaps. Definitely a stupid oversight.