+ All Categories
Home > Documents > MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI...

MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI...

Date post: 10-Sep-2018
Category:
Upload: danglien
View: 242 times
Download: 0 times
Share this document with a friend
58
MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics [email protected]
Transcript
Page 1: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

MySQL GUI ToolsMySQL & PHP

Jeff Kopmanis, [email protected]

Page 2: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

Command Line Utility

Page 3: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

Command Line Utility

Page 4: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

Command Line Utility

Crowded

Page 5: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

Command Line Utility

Crowded

Not suited well for wide results

Page 6: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

Command Line Utility

Not suited well for wide results

Can’t see results & structure at the same time

Crowded

Page 7: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

GUI Tools

• Multi-platform

Page 8: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

GUI Tools

• Multi-platform

• Microsoft Windows

Page 9: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

GUI Tools

• Multi-platform

• Microsoft Windows

• Linux (RedHat, SuSE, Debian, Others)

Page 10: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

GUI Tools

• Multi-platform

• Microsoft Windows

• Linux (RedHat, SuSE, Debian, Others)

• MacOSX

Page 11: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

GUI Tools

• Multi-platform

• Microsoft Windows

• Linux (RedHat, SuSE, Debian, Others)

• MacOSX

• A “Workbench” for SQL tasks

Page 12: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

GUI Tools

• Multi-platform

• Microsoft Windows

• Linux (RedHat, SuSE, Debian, Others)

• MacOSX

• A “Workbench” for SQL tasks

• STANDARD!

Page 13: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

GUI Tools

• Multi-platform

• Microsoft Windows

• Linux (RedHat, SuSE, Debian, Others)

• MacOSX

• A “Workbench” for SQL tasks

• STANDARD!

• Open Source - FREE!

Page 14: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

MySQL Administrator

Page 15: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

MySQL Administrator• GUI Administrative Tool

Page 16: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

MySQL Administrator• GUI Administrative Tool

• Open Source - Freely available

Page 17: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

MySQL Administrator• GUI Administrative Tool

• Open Source - Freely available

• Maintained by MySQL AB

Page 18: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

MySQL Administrator• GUI Administrative Tool

• Open Source - Freely available

• Maintained by MySQL AB

• Available on major OS’s

Page 19: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

MySQL Administrator• GUI Administrative Tool

• Open Source - Freely available

• Maintained by MySQL AB

• Available on major OS’s

• Windows

Page 20: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

MySQL Administrator• GUI Administrative Tool

• Open Source - Freely available

• Maintained by MySQL AB

• Available on major OS’s

• Windows

• Linux

Page 21: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

MySQL Administrator• GUI Administrative Tool

• Open Source - Freely available

• Maintained by MySQL AB

• Available on major OS’s

• Windows

• Linux

• MacOSX

Page 22: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

MySQL Administrator

Demo

Page 23: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

MySQL Query Browser

Page 24: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

MySQL Query Browser

Page 25: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

MySQL Query Browser

Page 26: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

MySQL Query Browser

Page 27: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

MySQL Query Browser

Page 28: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

CocoaMySQL

Demo

Page 29: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

Dynamic Web Pages

MySQL & PHP

Page 30: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

“Why would I want to use a Dynamic page!?”

Page 31: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

“Why would I want to use a Dynamic page!?”

• When content has to be updated frequently

Page 32: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

“Why would I want to use a Dynamic page!?”

• When content has to be updated frequently

• When content is interdependent

Page 33: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

“Why would I want to use a Dynamic page!?”

• When content has to be updated frequently

• When content is interdependent

• When you want a page to be configurable

Page 34: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

“Why would I want to use a Dynamic page!?”

• When content has to be updated frequently

• When content is interdependent

• When you want a page to be configurable

• When other software has to get at the data

Page 35: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

“Why would I want to use a Dynamic page!?”

• When content has to be updated frequently

• When content is interdependent

• When you want a page to be configurable

• When other software has to get at the data

• What’s your idea for a dynamic page?

Page 36: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

Anatomy of a Dynamic Web Page

SafariBrowser

http://www.umich.edu/somepage.php

1. Submit a URL to your browser

Page 37: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

Anatomy of a Dynamic Web Page

SafariBrowser

WebServer

http://www.umich.edu/somepage.php

2. Browser sends request to web server

Page 38: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

Anatomy of a Dynamic Web Page

SafariBrowser

WebServer

ScriptLanguage

somepage.php

3. Web server runs a script

Page 39: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

Anatomy of a Dynamic Web Page

SafariBrowser

WebServer

ScriptLanguage

SQLDatabase

4. Script makes SQL Queries for data

SELECT * FROM dtable

Page 40: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

Anatomy of a Dynamic Web Page

SafariBrowser

WebServer

ScriptLanguage

SQLDatabase

5. Database returns data to script for processing

123, Jeff456, Mary789, Dave

Page 41: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

Anatomy of a Dynamic Web Page

SafariBrowser

WebServer

ScriptLanguage

SQLDatabase

6. Script prepares HTML and sends it to the Web Server

...<td>123</td><td>Jeff</td></tr><tr><td>456...

Page 42: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

Anatomy of a Dynamic Web Page

SafariBrowser

WebServer Script

Language

SQLDatabase

7. Web server finishes processing andsends stream to your browser

...<td>123</td><td>Jeff</td></tr><tr><td>456...

Page 43: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

Anatomy of a Dynamic Web Page

SafariBrowser

8. Your browser renders the HTML and displays the formatted results

Page 44: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

Some PHP Examples

Page 45: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

hello.php

<?print "Hello, World!";?>

Page 46: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

hello.php

<?print "Hello, World!";?>

WORLD’S SIMPLEST

PROGRAM

Page 47: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

hello_vars.php

<center><?$hello = “Hello”;$world = “World”;print $hello.”, “.$world.”<br>”;?></center><hr>

Page 48: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

hello_vars.php

<center><?$hello = “Hello”;$world = “World”;print $hello.”, “.$world.”<br>”;?></center><hr>

WORLD’S SECOND

SIMPLEST PROGRAM

Page 49: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

db.php<?######################## Make Database connection$db = mysql_connect("localhost","root","");mysql_select_db("inventory",$db);

$sql = "SELECT ipaddr,hostname FROM machines”;$result = mysql_query($sql);

while( $datarow = mysql_fetch_array($result) ) { # 2 print statements for prettiness! print “ip=”.$datarow[‘ipaddr’]; print ” hostname=”.$datarow[‘host’].”<br>\n”; }

mysql_close($db);?>

Page 50: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

db.php

Page 51: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

db_form.php<?######################## Make Database connection$db = mysql_connect("localhost","root","");mysql_select_db("inventory",$db);

# shows how concatenation can be used to build strings$sql = "SELECT ipaddr,hostname FROM machines“;$sql .= “ WHERE hostname='".$_GET['fhost']."'";$result = mysql_query($sql);

while( $datarow = mysql_fetch_array($result) ) { print "ip=".$datarow['ipaddr']; print " hostname=".$datarow['hostname']."<br>\n"; }

mysql_close($db);?>

Page 52: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

db_form.php

Page 53: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

all_in_one.php<html><head><title>All-in-One PHP File</title></head><form method=post action="all_in_one.php"><input type=text name="fhost" value='<?=$_POST[fhost]?>' size=25 maxlength=25><input type=submit value=' LOOK IT UP! '></form><hr><table width=100%><?######################## Make Database connection$db = mysql_connect("localhost","root","");mysql_select_db("inventory",$db);

$sql = "SELECT hostname,ipaddr FROM machines WHERE hostname='".$_POST[fhost].”’”;$result = mysql_query($sql);

while( $datarow = mysql_fetch_array($result) ) { print "<tr><td width=50%>$datarow[‘hostname’]</td><td width=50%>"; print $datarow[‘ipaddr’]; print "</td></tr>\n"; } print "<tr><td colspan=2><hr></td></tr>\n";

?></table></html>

Page 54: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

all_in_one.php

Page 55: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

PHP-enabled Sites

Demo

Page 56: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

Online Resources

• http://www.mysql.comMySQL Home

• http://serverlogistics.com/mysql.phpComplete MySQL

• http://www.php.net/PHP Home page

• http://versiontracker.comWhere to find CocoaMySQL

Page 57: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

Books

PHP and MySQL Web Development(3rd Edition)Luke Welling, Laura ThompsonISBN: 0672326728

PHP CookbookDavid Sklar, Adam TrachtenbergISBN: 1565926811

Page 58: MySQL GUI Tools MySQL & PHP - University of …kopmanis/present/Mysql-PHP-pres.pdf · MySQL GUI Tools MySQL & PHP Jeff Kopmanis, Mathematics kopmanis@umich.edu

Q & A

Thanks for coming!


Recommended