James Bond Movie Information
There have been 23 different James Bond films, and six different Bonds. I could type out the information for each film in this file, but why would I do that!? I have a much better solution.
First I created a simple SQL script containing all the information on James Bond films produced by Eon Production. So of course we are omitting the first Casino Royale, which was actually a parody starring David Niven; Never Say Never Again, the completely necessary remake of Thunderball; and the ultimate classic, James Bond Jr., because that show totally made sense.
Throwing that into a PostgreSQL database was really simple, and once that's done, it's just a matter of connecting the page to the database with the pg_connect
function, then conducting a standard SQL query with the pg_query
function. Then, a simple for
loop containing the pg_fetch_result
command, which would retrieve the data, before throwing it all into a standard table.
All the data can actually be pulled out in a few lines of code, and can be edited in a much simpler fashion. For instance, if one wanted to add a single piece of information on these films, like the actor who played the big bad, all they would have to change is three lines of code, instead of 23. Which is nice.
Warning: pg_connect(): Unable to connect to PostgreSQL server: connection to server at "sql306.byethost10.com" (192.168.0.196), port 3306 failed: Permission denied Is the server running on that host and accepting TCP/IP connections? in /var/www/delta/intn2201/includes/functions.php on line 8
Fatal error: Uncaught TypeError: pg_query(): Argument #1 ($connection) must be of type PgSql\Connection, false given in /var/www/delta/intn2201/lab7_bond_info.php:34 Stack trace: #0 /var/www/delta/intn2201/lab7_bond_info.php(34): pg_query() #1 {main} thrown in /var/www/delta/intn2201/lab7_bond_info.php on line 34