added json_encode, javascript to print messages
valid student fine, issues with mysql/mysqli functions