Sunday, May 30, 2010

PHP - Advanced Tutorial

PHP - Advanced TutorialPHP - Advanced Tutorial Gulev December 6, 2002. Veracruz, Mexico Rasmus Lerdorf http://lerdorf.com/veracruz.pdf Slide 1/64 December 6, 2002Agenda o PHP-MySQL o Cookie Handling o Dynamic Images o PDF o Flash o Sessions o Security o Tips & Tricks o Optimization o Latest Developments o Future - 2 - Slide 2/64 December 6, 2002Setup Check your PHP Setup for MySQL support If not enabled Very rare since a MySQL client library is distributed with PHP and built into PHP by default. However, it is possible to build PHP without MySQL support. Some possible fixes: apt-get install php-mysql rpm -Uvh php-mysql-4.2.2-1.i386.rpm ./configure --with-mysql=shared,/usr cp modules/mysql.so /usr/local/lib/php extension_dir=/usr/local/lib/php extension=mysql.so - 3 - Slide 3/64 December 6, 2002Sanity Check Make sure MySQL is running prompt:~> mysqlshow +-----------+ | Databases | +-----------+ | mysql | | test | +-----------+ Or with the latest PHP Output: Uptime: 6717

Threads: 1 Questions: 1 Slow queries: 0 Opens: 6 Flush tables: 1 Open tables: 0 Queries per second avg: 0.000 - 4 - Slide 4/64 December 6, 2002Connecting to MySQL The simple connection Output: Resource id #28 Other variations - 5 - Slide 5/64 December 6, 2002Persistent Connections The simple connection Output: Resource id #31 Caveats o Watch out for multi-credential connections o Make sure you match up max_connections and MaxClients - 6 - Slide 6/64 December 6, 2002Creating a Database Create a DB Output: Database foo created Create a Table Output: Table created - 7 - Slide 7/64 December 6, 2002Inserting Data INSERT Query
Website: lerdorf.com | Filesize: 352kb
No of Page(s): 80
Download PHP - Advanced Tutorial.pdf

No comments:

Post a Comment