table is the name of the table in the database. $database in your example will contain a result set of rows from the database according to the query passed into the mysql_query function. It should probably be named $result instead of $database to give you a clearer understanding of what is happening.
Try to think of a database being like a filing cabinet. The tables in the database are the files in the filing cabinet and store the actual data.
EDIT: To actually connect to the database in php, check out the mysql_connect function. Once connected you run SQL queries using the mysql_query function and interrogate the result with the mysql_fetch_* functions.
darkagn
Veteran Poster
1,197 posts since Aug 2007
Reputation Points: 404
Solved Threads: 200
$result = mysql_query("SELECT * FROM table where id=%s, $id");
almostbob
Posting Sensei
3,149 posts since Jan 2009
Reputation Points: 571
Solved Threads: 376