Conclusion
Now the PHP code we wrote in Chapter 10 truly does what it is supposed to. Congratulations. Our trivia game now has a Flash interface that reads questions from a database somewhere. That's really cool.
Our PHP script obtains questions from a database and sends them out in XML. In this chapter, we learned how to have PHP connect to a MySQL server, obtain results from the server, and then parse the results. Further, we extended our knowledge of MySQL a little by learning about some group commands.
We also went through two versions. This experience taught us to try to eliminate loops whenever for extra speed.
| Command name
|
What it returns or uses
|
| MySQL_connect
|
Returns connection
|
| MySQL_close
|
Uses connection
|
| MySQL_pconnect
|
Returns connection
|
| MySQL_create_db
|
Uses connection
|
| MySQL_drop_db
|
Uses connection
|
| MySQL_db_select
|
Uses connection
|
| MySQL_query
|
Uses connection; returns result
|
| MySQL_result
|
Uses result
|
| MySQL_data_seek
|
Uses result
|
| MySQL_fetch_row
|
Uses result
|
| MySQL_fetch_array
|
Uses result
|
| MySQL_fetch_object
|
Uses result
|
| MySQL_num_rows
|
Uses result
|
| MySQL_free_result
|
Uses (and loses) result
|
|