Javascript While Loop Syntax Php Database