mySQL output properly casted