Unexpected end

<? php

include "db.php";
?>

Cat

query ($ query);
while ($ row = $ execute-> fetch_array ());
?>

:

I think it's ok but it gives me the mistake of Syntax error, unexpected T_ENDWHILE
I'm trying to create a chat by following this tutorial https://www.youtube.com/watch?v=wMlLgYyz_ws