<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>MySQL/PHP Classes @ LVS Online</title>
	
	<link>http://lvsonline.com/online-mysql-php-classes</link>
	<description>Learn MySQL and PHP online!</description>
	<lastBuildDate>Mon, 13 Apr 2009 03:19:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/MySQL_PHPClassesLVSOnline" /><feedburner:info uri="mysql_phpclasseslvsonline" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>MySQL_PHPClassesLVSOnline</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>5 Things I wish I had known about PHP</title>
		<link>http://feedproxy.google.com/~r/MySQL_PHPClassesLVSOnline/~3/kVfQy6Mor3I/</link>
		<comments>http://lvsonline.com/online-mysql-php-classes/php/5-things-i-wish-i-had-known-about-php/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 03:19:29 +0000</pubDate>
		<dc:creator>Bean</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[DOCUMENT_ROOT]]></category>
		<category><![CDATA[Separation of concerns]]></category>
		<category><![CDATA[Superglobal variables]]></category>

		<guid isPermaLink="false">http://lvsonline.com/online-mysql-php-classes/?p=144</guid>
		<description><![CDATA[Like most independent geeks, I started off by teaching myself PHP. I already knew Java, PERL, BASIC and ASP so many things about PHP were easy for me to learn. I rolled up my sleeves and went to work  coding interactive PHP web sites. I drank gallons of caffeine and cruised the PHP forums  at [...]]]></description>
			<content:encoded><![CDATA[<p>Like most independent geeks, I started off by teaching myself PHP. I already knew Java, PERL, BASIC and ASP so many things about PHP were easy for me to learn. I rolled up my sleeves and went to work  coding interactive PHP web sites. I drank gallons of caffeine and cruised the PHP forums  at all hours of the night, seeking answers to my PHP questions. I could have saved a lot of time, energy and sleep if I had been taught these five things about PHP.</p>
<h3>1) Code first, style second</h3>
<p style="padding-left: 30px;">The code is the backbone and structure to your web site.  Code your PHP, HTML and JavaScript before you dress up your pages. Make you code clean, make it solid and make it ugly. It is much easier to debug and validate your code without the styling. Once you have the basic structure in place and functioning, start adding your styles. If your styling is dynamic, for example a style sheet determined by a user selection, add in your logic</p>
<h3>2) Follow separations of concerns standards</h3>
<p style="padding-left: 30px;">Separations of concerns means segmenting your code so the HTML, the PHP and the styling are kept separate. At the top of your document, place as much of your documentation and scripts as you can. Make it as easy as possible to find your variables and code. Use linked CSS style sheets instead of embedded code.  Finding that missing semicolon is hard enough in reading through 30 lines of code. Sorting through 80 lines of code with tags scattered throughout is a nightmare that I lived through way too many times.</p>
<p style="padding-left: 30px;">Go a step further, once you have got your custom PHP functions operating smoothly, place those functions in include files with excellent documentation.  This makes your code more modular and easy to reuse.</p>
<h3>3) Well documented code saves time</h3>
<p style="padding-left: 30px;">OK, I had this drummed into my head in college, but that was for school, not for real life, right? Boy was I wrong! The first time I had to upgrade my code after two month intermission, I was saying all sorts of naughty words. The blue language and my foul mood could have been easily eliminated if I had documented my all of my PHP variable declarations, my loops and my functions.</p>
<h3>4) Creating a mail form is easy, creating a secure mail form not so easy</h3>
<p style="padding-left: 30px;">The PHP mail function looks easy but looks are deceiving. Mail is a spammers&#8217; gold mine and they spend a lot of time and energy trying to get <em><strong>your</strong></em> mail functions to work for them. It takes diligence to stay on top of their tricks. I have learned that using a current 3rd party script, from a reliable source, is the way to go. I don&#8217;t have the time or the intelligence to keep up with the spammers so I rely on those that do and keep my mail forms secure.<code></code></p>
<h3>5) DOCUMENT _ROOT is your friend</h3>
<p style="padding-left: 30px;">I am a big fan of includes. When Vikki taught me about includes and SHTML here at LVS Online long ago, I was ecstatic! It made much more sense to me than templates but I struggled with paths. How could I make my footer include work in my home directory and my nested directories. My navigation includes kept me up way too late at night. I am embarassed that my first PHP sites would have include folders for each level of directory and yes I would edit two levels of includes and forget to edit the third ARRRRGH.</p>
<p style="padding-left: 30px;">The PHP superglobal server variables were something I didn&#8217;t discover until over 6 months into my PHP ventures. $_SERVER["<em>DOCUMENT_ROOT</em>"] solves all of your include and multiple directory issues.</p>
<img src="http://feeds.feedburner.com/~r/MySQL_PHPClassesLVSOnline/~4/kVfQy6Mor3I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lvsonline.com/online-mysql-php-classes/php/5-things-i-wish-i-had-known-about-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://lvsonline.com/online-mysql-php-classes/php/5-things-i-wish-i-had-known-about-php/</feedburner:origLink></item>
		<item>
		<title>Learn MySQL/PHP and support Australian bush fire victims</title>
		<link>http://feedproxy.google.com/~r/MySQL_PHPClassesLVSOnline/~3/HuTooQqgTjo/</link>
		<comments>http://lvsonline.com/online-mysql-php-classes/reference/learn-mysqlphp-and-support-australian-bush-fire-victims/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 17:46:27 +0000</pubDate>
		<dc:creator>Bean</dc:creator>
				<category><![CDATA[Reference]]></category>
		<category><![CDATA[Books]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://lvsonline.com/online-mysql-php-classes/?p=140</guid>
		<description><![CDATA[The death toll  from the bush fires in Australia is 181 and counting, but you can help. Sitepoint, an Australian web designcompany,  is offering a huge sale on their excellent books. You can buy five books for the price of one and 100% of the proceeds will go to benefit the brush fire victims. The [...]]]></description>
			<content:encoded><![CDATA[<p>The death toll  from the<a href="http://edition.cnn.com/2009/WORLD/asiapcf/02/10/australia.bushfire.survivor/index.html#cnnSTCText" target="_blank"> bush fires in Australia is 181</a> and counting, but you can help. Sitepoint, an Australian web designcompany,  is offering a huge sale on their excellent books. You can <a href="http://5for1.aws.sitepoint.com/" target="_blank">buy five books for the price of one</a> and 100% of the proceeds will go to benefit the brush fire victims. The sale goes through 2/13 so you will want to take advantage of this offer quickly. The loss of home and livelihood has been staggering and the Australian brush victims are in desperate need of assistance now.</p>
<p>Here are some books that I think may be of particular interest for MySQL and PHP students:</p>
<p id="title-book"><a href="http://www.sitepoint.com/books/phpant2/" target="_blank">The PHP Anthology: 101 Essential Tips, Tricks &amp; Hacks, 2nd Edition</a></p>
<p><a href="http://www.sitepoint.com/books/phpmysql1/">Build Your Own Database Driven Website Using PHP &amp; MySQL</a></p>
<p><a href="http://www.sitepoint.com/books/css2/">HTML Utopia: Designing Without Tables Using CSS, 2<sup>nd</sup> Edition</a></p>
<p><a href="http://www.sitepoint.com/books/cssant2/">The CSS Anthology: 101 Essential Tips, Tricks &amp; Hacks, 2<sup>nd</sup> Edition</a></p>
<p><a href="http://www.sitepoint.com/books/html1/">Build Your Own Web Site The Right Way Using HTML &amp; CSS</a></p>
<p><a href="http://www.sitepoint.com/books/javascript1/">Simply JavaScript</a></p>
<p><a href="http://www.sitepoint.com/books/design1/">The Principles of Beautiful Web Design</a></p>
<p>Once you have selected your books, be sure to use the<a href="http://5for1.aws.sitepoint.com/" target="_blank"> form here</a> to get the sale pricing and to make sure that all proceeds go to the brush fire victims.</p>
<img src="http://feeds.feedburner.com/~r/MySQL_PHPClassesLVSOnline/~4/HuTooQqgTjo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lvsonline.com/online-mysql-php-classes/reference/learn-mysqlphp-and-support-australian-bush-fire-victims/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://lvsonline.com/online-mysql-php-classes/reference/learn-mysqlphp-and-support-australian-bush-fire-victims/</feedburner:origLink></item>
		<item>
		<title>New PHP Study Group</title>
		<link>http://feedproxy.google.com/~r/MySQL_PHPClassesLVSOnline/~3/laL3LCLuq-M/</link>
		<comments>http://lvsonline.com/online-mysql-php-classes/php/new-php-study-group/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 19:26:00 +0000</pubDate>
		<dc:creator>Bean</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Study group]]></category>

		<guid isPermaLink="false">http://lvsonline.com/online-mysql-php-classes/?p=134</guid>
		<description><![CDATA[LVS students have banded together to create a new PHP study group. This PHP study group is LVS students and alumni that want to help each other in their PHP pursuits. They are beginning with PHP for the World Wide Web, Second Edition (Visual QuickStart Guide) which is an excellent beginning PHP text.
You can join the [...]]]></description>
			<content:encoded><![CDATA[<p>LVS students have banded together to create a new PHP study group. This PHP study group is LVS students and alumni that want to help each other in their PHP pursuits. They are beginning with <a href="http://www.amazon.com/gp/product/0321245652?ie=UTF8&amp;tag=mysql-php-courses-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0321245652">PHP for the World Wide Web, Second Edition (Visual QuickStart Guide)</a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=mysql-php-courses-20&amp;l=as2&amp;o=1&amp;a=0321245652" border="0" alt="" width="1" height="1" /> which is an excellent beginning PHP text.</p>
<p>You can join the PHP study group at <a href="http://lzydaz.com/phpBB3/">Hello World</a>.  Kudos to Bonnie and Joanne for taking the initiative to get this going!</p>
<img src="http://feeds.feedburner.com/~r/MySQL_PHPClassesLVSOnline/~4/laL3LCLuq-M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lvsonline.com/online-mysql-php-classes/php/new-php-study-group/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://lvsonline.com/online-mysql-php-classes/php/new-php-study-group/</feedburner:origLink></item>
		<item>
		<title>Intro to MySQL – Jan 08</title>
		<link>http://feedproxy.google.com/~r/MySQL_PHPClassesLVSOnline/~3/61_jpbNp_tY/</link>
		<comments>http://lvsonline.com/online-mysql-php-classes/mysql/mysql_intro_jan08/#comments</comments>
		<pubDate>Sat, 03 Jan 2009 19:26:38 +0000</pubDate>
		<dc:creator>Bean</dc:creator>
				<category><![CDATA[Class Announcements]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Classes]]></category>

		<guid isPermaLink="false">http://lvsonline.com/online-mysql-php-classes/?p=130</guid>
		<description><![CDATA[Introduction to Database Development with MySQL &#8211; get organized for the new year. Databases are a great way to organize all kind of data from your books to your products to your contacts. In this course, you will use special database accounts on the LVS server to create an address database. We will be using [...]]]></description>
			<content:encoded><![CDATA[<p>Introduction to Database Development with MySQL &#8211; get organized for the new year. Databases are a great way to organize all kind of data from your books to your products to your contacts. In this course, you will use special database accounts on the LVS server to create an address database. We will be using MySQL 4 for this course. Anita will be the assistant this session.</p>
<p>LVS Online MySQL database class starts on 1/10/09. <a href="http://www.lvsassociates.com/register/product_info.php?products_id=223">Register now</a>!</p>
<img src="http://feeds.feedburner.com/~r/MySQL_PHPClassesLVSOnline/~4/61_jpbNp_tY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lvsonline.com/online-mysql-php-classes/mysql/mysql_intro_jan08/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://lvsonline.com/online-mysql-php-classes/mysql/mysql_intro_jan08/</feedburner:origLink></item>
		<item>
		<title>PHP for Web Developers course starts soon</title>
		<link>http://feedproxy.google.com/~r/MySQL_PHPClassesLVSOnline/~3/3eFRQE2-4X0/</link>
		<comments>http://lvsonline.com/online-mysql-php-classes/class-announcements/php101_jan08/#comments</comments>
		<pubDate>Sat, 03 Jan 2009 08:43:40 +0000</pubDate>
		<dc:creator>Bean</dc:creator>
				<category><![CDATA[Class Announcements]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[PHP4]]></category>
		<category><![CDATA[PHP5]]></category>

		<guid isPermaLink="false">http://lvsonline.com/online-mysql-php-classes/?p=120</guid>
		<description><![CDATA[Its not too late to register for PHP 101 for Web Developers at LVS Online!
Learn how to use PHP4 or PHP5 to make your web site more dynamic and interactive.  Utilize PHP to automate some of the more mundane tasks of your web site and prevent errors, all while creating a standards compliant web site.
We [...]]]></description>
			<content:encoded><![CDATA[<p>Its not too late to <a href="http://www.lvsassociates.com/register/product_info.php?products_id=136">register for PHP 101 for Web Developers</a> at LVS Online!</p>
<p>Learn how to use PHP4 or PHP5 to make your web site more dynamic and interactive.  Utilize PHP to automate some of the more mundane tasks of your web site and prevent errors, all while creating a standards compliant web site.</p>
<p>We have changed the staffing of this course to provide a cooperative learning experience. This session of PHP 101 for Web Developers will have an assistant, an instructor  and a back up instructor to help guide you through the assignments.</p>
<p>The online PHP classroom opens on Monday and the first lesson will be posted on 1/10/09. <span style="color: #ff0000;"><strong><a href="http://www.lvsassociates.com/register/product_info.php?products_id=136">Registration</a> ends soon!</strong></span></p>
<img src="http://feeds.feedburner.com/~r/MySQL_PHPClassesLVSOnline/~4/3eFRQE2-4X0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lvsonline.com/online-mysql-php-classes/class-announcements/php101_jan08/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://lvsonline.com/online-mysql-php-classes/class-announcements/php101_jan08/</feedburner:origLink></item>
		<item>
		<title>Attention LVS Students!</title>
		<link>http://feedproxy.google.com/~r/MySQL_PHPClassesLVSOnline/~3/h6JLmvmqD5g/</link>
		<comments>http://lvsonline.com/online-mysql-php-classes/class-announcements/attention-lvs-students/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 00:44:09 +0000</pubDate>
		<dc:creator>Bean</dc:creator>
				<category><![CDATA[Class Announcements]]></category>
		<category><![CDATA[LVS Online]]></category>

		<guid isPermaLink="false">http://lvsonline.com/online-mysql-php-classes/?p=116</guid>
		<description><![CDATA[Tell us who you are and which class(es) you are enrolled in this session. Let us know how LVS classes has affected your life in your professional field and/or in your personal life. Which ones have been your favorites? We enjoy hearing of your experiences. Thanks for sharing with LVS staff, fellow LVS students and [...]]]></description>
			<content:encoded><![CDATA[<p>Tell us who you are and which class(es) you are enrolled in this session. Let us know how LVS classes has affected your life in your professional field and/or in your personal life. Which ones have been your favorites? We enjoy hearing of your experiences. Thanks for sharing with LVS staff, fellow LVS students and our blog visitors!</p>
<p>If you’d like to view other students experiences at LVS Online Classes, visit the <a href=" http://www.lvsonline.com/blog/ " target="_blank">main LVS Blog </a>and click the Blogroll links.</p>
<img src="http://feeds.feedburner.com/~r/MySQL_PHPClassesLVSOnline/~4/h6JLmvmqD5g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lvsonline.com/online-mysql-php-classes/class-announcements/attention-lvs-students/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		<feedburner:origLink>http://lvsonline.com/online-mysql-php-classes/class-announcements/attention-lvs-students/</feedburner:origLink></item>
		<item>
		<title>How does PHP compare to Ruby on Rails, Django, Python etc?</title>
		<link>http://feedproxy.google.com/~r/MySQL_PHPClassesLVSOnline/~3/MrkcxwMm_40/</link>
		<comments>http://lvsonline.com/online-mysql-php-classes/php/how-does-php-compare-to-ruby-on-rails-django-python-etc/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 19:38:59 +0000</pubDate>
		<dc:creator>Bean</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[PHP5]]></category>
		<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://lvsonline.com/online-mysql-php-classes/?p=100</guid>
		<description><![CDATA[This question came up recently on the PHP class boards about scripts and frameworks  such as Ruby, Django, Python, CakePHP and Symfony. I thought that it was worthy of some discussion here and moved the thread to the blog.
How does PHP compare to other server side languages? I&#8217;ve been reading up on it a bit, [...]]]></description>
			<content:encoded><![CDATA[<p>This question came up recently on the PHP class boards about scripts and frameworks  such as Ruby, Django, Python, CakePHP and Symfony. I thought that it was worthy of some discussion here and moved the thread to the blog.</p>
<blockquote><p>How does PHP compare to other server side languages? I&#8217;ve been reading up on it a bit, and it seems like some developers are quite antagonistic toward PHP, in favor of Django, Python, Ruby, Symfony, etc. instead. Do you favor PHP with MySQL? What do you think of Ruby on Rails or the other various combinations? I&#8217;m interested in developing web apps and am not sure where I should focus my attention. I&#8217;m new to all of this.</p></blockquote>
<p>First, we need to make the distinction between scripting languages and frameworks. Frameworks are language specific tools that assist you in creating web applications, in particular database driven web sites. Pylons gives a good description of the components of frameworks.</p>
<ul>
<blockquote>
<li>something that generates HTML</li>
<li>something that reads arguments that are sent via HTTP</li>
<li>something that communicates with your database</li>
<li>something that contains your application logic</li>
<li>something that deals with user accounts</li>
<li>something that stores persistent data (like cookie-based sessions)</li>
</blockquote>
</ul>
<p>The big benefit to frameworks is that they come with libraries of frequently used code components that can save you hours in development time. Instead of writing something from scratch and debugging, you can pop in components and just customize arguments.</p>
<p>PHP frameworks include: <a href="http://www.symfony-project.org/" target="_blank">Symfony</a>, <a href="http://framework.zend.com/" target="_blank">Zend</a>, <a href="http://cakephp.org/" target="_blank">CakePHP</a>, and <a href="http://codeigniter.com/" target="_blank">CodeIgniter</a></p>
<p>Ruby framework is <a href="http://www.rubyonrails.org/" target="_blank">Rails</a></p>
<p>Python frameworks include: <a href="http://www.djangoproject.com/" target="_blank">Django</a>, <a href="http://pylonshq.com/" target="_blank">Pylon</a>, <a href="http://turbogears.org/" target="_blank">Turbogears</a></p>
<p>To utilize these frameworks, you will want to have at least a basic knowledge of the underlying scripting language. Ruby has been getting a lot of attention because it is object oriented and PHP has just recently entered the objected oriented programming (OOP) arena. Of the three, I think Python has the steepest learning curve for the base language but I have to admit that I haven&#8217;t played with it in at least two years. I think that Ruby could give PHP some competition down the road but not immediately. I see Python and Ruby being relegated to the  geek corner for awhile, while PHP continues to be the predominant scripting language.</p>
<p>Why PHP?</p>
<ul>
<li>it is already installed on most web servers and works great with the most popular web server in the world, Apache. Ruby and Python often require separate installations and can be intimidating.</li>
<li>PHP is widely available on inexpensive hosting plans. Since Ruby and Python usually require additional installations, web hosting accounts with these languages installed tend to be more expensive.</li>
<li>Although all three languages have rich frameworks available to them, for every 10 shopping cart, forum, blog, content management, mailing list applications based on PHP you will find one or less based on Python or Ruby. It is much easier to add PHP applications to your project because you have so many choices.</li>
<li>Since there are many more trained PHP developers than Python and/or Ruby developers available, PHP web applications tend to less expensive to maintain.</li>
<li>Although PHP 4 was at a disadvantage, PHP 5 and 6 have greatly improved object oriented programming capabilities that challenge Python and Ruby. Although Ruby still exceeds in this regard, it is more complicated to install on a Linux system and retain all of the flexibility of the language and framework. It has a dramatically reduced number of applications to interact with as well.</li>
</ul>
<p>This is just a brief summary of the languages and frameworks. There is considerable debate and programmers can become rabid fans of THEIR language/framework. I don&#8217;t believe there is just one answer to which is the best.  I do believe that PHP is the language to start with in terms of its learning curve, its widespread use and availability, its power and scalability and the sheer demand for PHP programmers. There is an interesting blog post and discussion at <a href="http://www.killersites.com/blog/2006/php-vs-ruby/" target="_blank">Killersites</a> that reenforces some of the arguments that we present here.</p>
<p>Once you have decided which language to pursue, you can start testing out frameworks. They all have their strengths and weaknesses.  If you google them, you will find fans and detractors for all of them. You really need to test them out and see what matches your needs and workstyle. Other times your place of business will determine which framework they want to use. Frameworks do not necessarily play nicely with each other. As time allows we will try to post some reviews of specific frameworks. Check back later.</p>
<p>We welcome your thoughts and comments on this debate.</p>
<img src="http://feeds.feedburner.com/~r/MySQL_PHPClassesLVSOnline/~4/MrkcxwMm_40" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lvsonline.com/online-mysql-php-classes/php/how-does-php-compare-to-ruby-on-rails-django-python-etc/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://lvsonline.com/online-mysql-php-classes/php/how-does-php-compare-to-ruby-on-rails-django-python-etc/</feedburner:origLink></item>
		<item>
		<title>PHP Random Image Generator: Arrays and numbers oh my!</title>
		<link>http://feedproxy.google.com/~r/MySQL_PHPClassesLVSOnline/~3/9hQ2DFBrmoI/</link>
		<comments>http://lvsonline.com/online-mysql-php-classes/php/php-random-image-generator-arrays-and-numbers-oh-my/#comments</comments>
		<pubDate>Sat, 13 Sep 2008 05:21:06 +0000</pubDate>
		<dc:creator>Bean</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Arrays]]></category>
		<category><![CDATA[Images]]></category>
		<category><![CDATA[Random Image Generator]]></category>

		<guid isPermaLink="false">http://lvsonline.com/online-mysql-php-classes/?p=79</guid>
		<description><![CDATA[In the second week of the PHP 101 for Web Developers course, we introduce arrays through a Random Image Generator. One of things that confuse students most about arrays is how they count. You are probably really used to starting counting with the number 1. When working with arrays, you have to learn how to count from 0!
Arrays store information in a very [...]]]></description>
			<content:encoded><![CDATA[<p>In the second week of the PHP 101 for Web Developers course, we introduce arrays through a Random Image Generator. One of things that confuse students most about arrays is how they count. You are probably really used to starting counting with the number 1. When working with arrays, you have to learn how to count from 0!</p>
<p>Arrays store information in a very precise order. At home, you might keep your household bills in a file box organized by month. If you want to know how much your electric bill was last March, you would look in your folder labeled March, the third folder. That assumes you store your bills by month and by year. What about if you stored your monthly bill folders in alphabetical order. It wouldn&#8217;t matter as long as you know where to look.</p>
<p>Arrays aren&#8217;t as lax about organization as we might be. PHP arrays <strong><em>always</em></strong> <span id="more-79"></span>assign positions starting with 0. If I created an array of the months, $months = array(&#8217;month1,&#8217;month2&#8242;,&#8217;month3&#8242;, &#8216;month4&#8242;, &#8216;month5&#8242;, &#8216;month6, &#8216;month7&#8242;,&#8217;month8,&#8217;month9&#8242;,&#8217;month10&#8242;, &#8216;month11&#8242;,&#8217;month12&#8242;);  I would be thinking March is the third month of the year so it is month3. Makes sense to the human so if I said I wanted to pull out the third item in my month array {$months[3]}, I might be pretty confused when I get month4 instead of month3. I get month4 because arrays start counting with 0, so position 3 in an array is really the fourth item in the array. $months = array(&#8217;Jan,&#8217;Feb&#8217;,'Mar&#8217;, &#8216;Apr&#8217;, &#8216;May&#8217;, &#8216;Jun, &#8216;Jul&#8217;,'Aug,&#8217;Sep&#8217;,'Oct&#8217;, &#8216;Nov&#8217;,'Dec&#8217;);  To get the value of Mar from the array, I would need to use  {$months[2]}.</p>
<p>So what does all of that have to do with our PHP random image generator? In our <a title="Random Image Generator Demo" href="http://lvsonline.com/online-mysql-php-classes/examples/php/wk2/goldy.php" target="_blank">Goldy example</a>, you were given an array of images that started with goldy0. I added numbers to those file names to organize the images and to show how arrays count positions. The function works regardless if you have numbers on the end of your images or not.  I could have used images named goldy32, goldy333, goldy 232 and $images[2]} would return goldy232. If I used goldy, goldfishbowl, goldfish then $images[2]} would return goldfish.</p>
<p>Notice anything missing? There are no file extensions for these image files. There are a lot of random image generators out there but this one has a couple of requirements:</p>
<ul>
<li>all the images need to be jpgs</li>
<li>the jpg file extension is <strong>NOT</strong> to be included in creating the array</li>
<li>all of the images need to be stored in the same folder, but you can change the folder path in the script</li>
</ul>
<p>$images = array(&#8217;fish0&#8242;,&#8217;fish1&#8242;,&#8217;fish2&#8242;, &#8216;fish3&#8242;, &#8216;fish4&#8242;, &#8216;fish5&#8242;, &#8216;fish6&#8242;);<br />
$i =rand(0, count($images)-1); //do NOT change.<br />
$randomImage = &#8220;images/{$images[$i]}.jpg&#8221;// change image folder path here if necessary</p>
<p>So in summary:</p>
<ul>
<li>it doesn&#8217;t matter what you name your images for this php random image generator</li>
<li>do not include the file extensions in your array</li>
<li>remember arrays start counting positions at 0<br />
 </li>
</ul>
<img src="http://feeds.feedburner.com/~r/MySQL_PHPClassesLVSOnline/~4/9hQ2DFBrmoI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lvsonline.com/online-mysql-php-classes/php/php-random-image-generator-arrays-and-numbers-oh-my/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://lvsonline.com/online-mysql-php-classes/php/php-random-image-generator-arrays-and-numbers-oh-my/</feedburner:origLink></item>
		<item>
		<title>Intro to MySQL databases: Question Week 2</title>
		<link>http://feedproxy.google.com/~r/MySQL_PHPClassesLVSOnline/~3/34P149_rPj0/</link>
		<comments>http://lvsonline.com/online-mysql-php-classes/class-announcements/intro-to-mysql-databases-question-week-2/#comments</comments>
		<pubDate>Sat, 06 Sep 2008 08:33:38 +0000</pubDate>
		<dc:creator>Bean</dc:creator>
				<category><![CDATA[Class Announcements]]></category>

		<guid isPermaLink="false">http://lvsonline.com/online-mysql-php-classes/?p=74</guid>
		<description><![CDATA[This week, the introduction to MySQL students have been looking at various database schemes as well as their own address database. Databases are everywhere in our lives these days. Think of things in your own life that are powered by databases, that are NOT web related.  In the intermediate course we turn our attention to [...]]]></description>
			<content:encoded><![CDATA[<p>This week, the introduction to MySQL students have been looking at various database schemes as well as their own address database. Databases are everywhere in our lives these days. Think of things in your own life that are powered by databases, that are NOT web related.  In the intermediate course we turn our attention to data driven web sites. But the first couple of weeks in the introduction course, I want you to think of databases on a larger stage.  Post two things in your life that are database driven and give a description of at least one table that might exist in that database.</p>
<blockquote><p>For example: My doctors&#8217; office tracks all appointments in their database. I would imagine that it has a table that contains information about the individual doctors, as well as a table that contains specific information about individual patients. My neighborhood video store has a database that lists all of the movies at that store. The movie table probably lists things like title, genre and year released.</p></blockquote>
<p>You don&#8217;t need to give a lot of detail. Just list two examples and for each example try to guess how at least one of those tables might organize information</p>
<img src="http://feeds.feedburner.com/~r/MySQL_PHPClassesLVSOnline/~4/34P149_rPj0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lvsonline.com/online-mysql-php-classes/class-announcements/intro-to-mysql-databases-question-week-2/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://lvsonline.com/online-mysql-php-classes/class-announcements/intro-to-mysql-databases-question-week-2/</feedburner:origLink></item>
		<item>
		<title>Google released their Windows browser: Chrome</title>
		<link>http://feedproxy.google.com/~r/MySQL_PHPClassesLVSOnline/~3/TRCkaKsJk2k/</link>
		<comments>http://lvsonline.com/online-mysql-php-classes/class-announcements/google-released-their-browser-for-windows-chrome/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 05:44:35 +0000</pubDate>
		<dc:creator>jeramie</dc:creator>
				<category><![CDATA[Class Announcements]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google chrome]]></category>
		<category><![CDATA[new browser]]></category>

		<guid isPermaLink="false">http://lvsonline.com/online-mysql-php-classes/?p=68</guid>
		<description><![CDATA[http://www.google.com/googlebooks/chrome/
]]></description>
			<content:encoded><![CDATA[<div id="attachment_71" class="wp-caption alignnone" style="width: 113px"><a href="http://lvsonline.com/online-mysql-php-classes/wp-content/uploads/2008/09/chrome.jpg"><img class="size-thumbnail wp-image-71 " title="chrome" src="http://lvsonline.com/online-mysql-php-classes/wp-content/uploads/2008/09/chrome-103x150.jpg" alt="Google chrome information" width="103" height="150" /></a><p class="wp-caption-text">Google Chrome </p></div>
<p><a href="http://www.google.com/googlebooks/chrome/">http://www.google.com/googlebooks/chrome/</a></p>
<img src="http://feeds.feedburner.com/~r/MySQL_PHPClassesLVSOnline/~4/TRCkaKsJk2k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lvsonline.com/online-mysql-php-classes/class-announcements/google-released-their-browser-for-windows-chrome/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://lvsonline.com/online-mysql-php-classes/class-announcements/google-released-their-browser-for-windows-chrome/</feedburner:origLink></item>
	</channel>
</rss>
