PHP and mySQL 2/9/2007


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

PHP and mySQL 2/9/2007

  1. 1. PHP and mySQL 2/9/2007
  2. 2. What is PHP? <ul><li>From “PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML” </li></ul><ul><li>From IBM “PHP is the market-leading dynamic language for producing modern Web applications.” </li></ul><ul><li>Usage </li></ul><ul><li>Random link </li></ul><ul><li>On-line documentation - </li></ul>
  3. 3. What is mySQL? <ul><li>From http://www. mysql .com/why-mysql/ “the MySQL® database has become the world's most popular open source database because of its consistent fast performance, high reliability and ease of use. It's used in more than 10 million installations ranging from large corporations to specialized embedded applications on every continent in the world.” </li></ul><ul><li>Top 10 Reasons for mySQL </li></ul><ul><li>Random Link </li></ul><ul><li>Fastest growing fields </li></ul>
  4. 4. Communication between PHP and a mySQL Database <ul><li>http: //devzone . zend .com/node/view/id/641 </li></ul>
  5. 5. The Server <ul><li> </li></ul><ul><li>Login: your email account name </li></ul><ul><li>Password: “mmas” + the first 4 of the last 5 digits of your university id number. </li></ul><ul><ul><li>Example: if my id = 1234567890, my password will be mmas6789 </li></ul></ul>
  6. 6. Accessing mySQL and PHP <ul><li>If you execute which php and which mysql you will see antiquated versions. We want to use current versions which are installed at /usr/local/… </li></ul><ul><li>Change your PATH in your .profile in your home directory </li></ul>
  7. 7. Set up access on the database <ul><li>From the mySQL command line: </li></ul><ul><ul><li>grant select on nallbbco_bonsaidb.* to rfidclass@&quot;%&quot; identified by 'bonsai' ; </li></ul></ul>
  8. 8. Accessing the Database from the Command Line <ul><li>multimedia:~ reiser$ mysql -u rfidclass -pbonsai </li></ul><ul><li>Welcome to the MySQL monitor. Commands end with ; or g. </li></ul><ul><li>Your MySQL connection id is 14 to server version: 5.0.27-standard-log </li></ul><ul><li>Type 'help;' or 'h' for help. Type 'c' to clear the buffer. </li></ul><ul><li>mysql> </li></ul>
  9. 9. <ul><li>mysql> use nallbbco_bonsaidb </li></ul><ul><li>Database changed </li></ul><ul><li>mysql> show tables; </li></ul><ul><li>+-----------------------------+ </li></ul><ul><li>| Tables_in_nallbbco_bonsaidb | </li></ul><ul><li>+-----------------------------+ </li></ul><ul><li>| biology | </li></ul><ul><li>| grouping | </li></ul><ul><li>| grp_audio | </li></ul><ul><li>| grp_image | </li></ul><ul><li>| grp_video | </li></ul><ul><li>| grpbio | </li></ul><ul><li>| link | </li></ul><ul><li>| news | </li></ul><ul><li>| pos | </li></ul><ul><li>| shelf | </li></ul><ul><li>+-----------------------------+ </li></ul><ul><li>10 rows in set (0.00 sec) </li></ul>
  10. 10. Using Dreamweaver with PHP and mySQL <ul><li>Dreamweaver is Adobe’s web authoring software and it has fairly good support for php and mySQL. </li></ul><ul><li>You can download a trial version of Dreamweaver for 1 month’s free use. </li></ul><ul><li>You may use Dreamweaver in either of the MMAS labs - RBH 223 and KH 245 </li></ul><ul><ul><li>Those stations are not secure. </li></ul></ul><ul><ul><li>Do not leave your files on the desktop - if you work locally, copy the site folder to the server and delete it before leaving the lab. </li></ul></ul><ul><ul><li>Logout of the server before leaving the computer. </li></ul></ul><ul><ul><li>Close the door behnd you when you leave the lab . </li></ul></ul>
  11. 11. Features in Dreamweaver <ul><li>Built in validation. </li></ul><ul><li>Point and click interface. </li></ul><ul><li>Ability to view the code in the Code window; and edit the code for optimization, tweaking and customization. </li></ul><ul><li>Instant gratification of previewing in the Design window. </li></ul>