The data is taken from MySQL database and then that data is displayed as it appears in the table. This is quiet a difficult task to do, but don't worry i have made this easy enough to understand.
Read this post on code2learn.com