Comments

hmm why not die(mysqlerror()) or die(mysqlerror().$query) getting the query but with the actual error message ?
and there must be some reason for that line I just don't seem to see it - $returnarray = array ();