an end-to-end example: a php website with a mysql databasejbrunelle/cs518/lectures/lecture12.pdf ·...
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/1.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/2.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/3.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/4.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/5.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/6.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/7.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/8.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/9.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/10.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/11.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/12.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/13.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/14.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/15.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/16.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/17.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/18.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/19.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/20.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/21.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/22.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/23.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/24.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/25.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022081407/60556e47f978a75bbc6120b3/html5/thumbnails/26.jpg)
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