Shouldn't this:
echo '<p>Creating Table(s)...</p>'; sleep(3); echo '<p>Done.</p>';
display creating tables, pause for 3 seconds and then display done?
All it does is pause for 3 seconds and then displays all at once...
you're output is sitting in the buffer during the 3 secs
add a flush(); before the sleep();