an end-to-end example: a php website with a mysql databasejbrunelle/cs518/lectures/lecture12.pdf ·...

26
An end-to-end example: A PHP website with a MySQL database

Upload: others

Post on 16-Oct-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

An end-to-end example:A PHP website with a MySQL database

Page 2: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

PHP My Admin

● http://localhost/phpmyadmin/index.php

Page 3: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Create a Database

Page 4: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Create a table

Page 5: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Create tables

Page 6: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Create more tables

Page 7: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Insert makes

Page 8: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Insert data

Page 9: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Browse the data

Page 10: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Find info...

Page 11: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Export DB

Page 12: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Make some PHP files...

Page 13: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

SQL connection...

Page 14: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

HTML Setup

Page 15: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Query Logic

Page 16: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Runs...

Page 17: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Runs...

Page 18: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Runs...

Page 19: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Runs...

Page 20: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Runs...

Page 21: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Runs...

Page 22: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Runs...

Page 23: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Runs...

Page 24: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Runs...

Page 25: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Try it at home...

● https://github.com/jbrunelle/ODUCS418F16/blob/master/examples/cars.sql

● mysql -uroot --force --verbose < cars.sql● https://github.com/jbrunelle/ODUCS418F16/blo

b/master/examples/explore_cars.php

Page 26: An end-to-end example: A PHP website with a MySQL databasejbrunelle/cs518/lectures/lecture12.pdf · phpMyAdmin Current Server: localhost (Recent tables) information schema mysql mysqltest

Check in your code...

● http://rogerdudler.github.io/git-guide/● git init● git add *● git commit -m “committing my sql dump and php

files to my repo”● git push origin master