I think you'd be better off making a new thread about this one. You'll need to post the rendered HTML/JS and I think just over a page of replies with PHP information will reduce the amount of replies you get. The problem is simple, it just doesn't appear to be populating the input fields. I just don't know what the reason is and I can't go through all that JS to find it.
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php