01.02.2014, 20:09
You should not ever use fetch_row and retrieve_row at the same time since both functions increase the row pointer. It's probably trying to fetch a second - non-existent - row which returns NULL, breaking the whole thing.