Intro to #memtech PHP 2011-12-05

download Intro to #memtech PHP   2011-12-05

If you can't read please download the document

Transcript of Intro to #memtech PHP 2011-12-05

  • 1.
    • Intro to #memtech: PHP December 5, 2011
    • Jeremy Kendall
    • http://about.me/jeremykendall

2. Who is this guy?

  • Jeremy Kendall PHP developer since about 2001 Organizer of Memphis PHP Zend Frameworkexpertfanboi Speaker Photographer Sometime blogger Sometime open source contributor Not as smart as you
  • #memtech

3. Following Along

  • You can follow along with the presentation code at github.com. http://github.com/jeremykendall/bookshelf

4. What is PHP?

  • Scripting language

5. Designed for the web 6. Cross-platform 7. Free (as in beer) 8. Getting started

  • Included in most Linux distributions

9. Included in OS X 10. Mac: MAMP, MacPorts, Homebrew . . . 11. Windows: WampServer, xampp 12. Google, follow instructions, and . . . 13. . . . you can be coding in about 5 minutes 14. Why Did You(or why do you want to) Start Programming? 15. I Wanted to Solve Problems

  • I usually caused more problems than I solved

16. We'll solve a problem together 17. Create a typical first web application 18. Make horrible mistakes 19. Correct those mistakes 20. Make a cool improvement 21. Learn something? 22. What's the Problem?

  • I want to create an application that stores and displays books from my bookshelf

23. Requirements:

  • Display books

24. Add books 25. Edit books 26. Delete books Why no delete? I ran out of time and energy. 27. So, What do we Need?

  • Database (sqlite)

28. View (index.php) 29. Form (book-form.php) 30. Form processor (process-form.php) 31. index.php 32. book-form.php 33. Database Schema CREATE TABLE bookshelf( idINTEGER PRIMARY KEY , title, author ); 34. index.php db connection < table > < tr > < th > Title th >< th > Author th > tr > < tr > < td > < a href= "book-form.php?id=" > a > td > < td > td > tr > table > < p > We have no books! p > 39. index.php books table < table > < tr > < th > Title th >< th > Author th > tr > < tr > < td > < a href= "book-form.php?id=" > a > td > < td > td > tr > table > < p >We have no books! p > 40. index.php books table < table > < tr > < th >Title th >< th >Author th > tr > < tr > < td > < a href= "book-form.php?id=" > a > td > < td > td > tr > table > < p >We have no books! p > 41. index.php books table < table > < tr > < th >Title th >< th >Author th > tr > < tr > < td > < ahref="book-form.php?id="> a > td > < td > td > tr > table > < p > We have no books! p > 42. book-form.php