<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1619725840347992526</id><updated>2011-11-27T15:20:09.319-08:00</updated><title type='text'>Introduction to PHP</title><subtitle type='html'>Learn PHP programing free with our easy to understand tutorial. Learn to make your own website using PHP.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://lectures-php.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-1347313374798436220</id><published>2009-03-02T09:58:00.001-08:00</published><updated>2010-12-20T02:28:28.204-08:00</updated><title type='text'>Introduction</title><content type='html'>PHP is a language that was  designed to be easily embedded into HTML pages. Most PHP pages have PHP  code and HTML intermixed. When a Web server reads a PHP page, it is  looking for two things to let it know it should start reading the page as PHP rather than HTML, the start and end PHP tags: &amp;lt;?php and ?&amp;gt;, respectively.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Get Started:&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;h1&amp;gt;&amp;lt;? echo “First PHP Page.”; ?&amp;gt;!&amp;lt;/h1&amp;gt;&lt;/p&gt;&lt;p&gt;The code above, when viewed via a Web server, simply prints out String enclosed in the quotes.&lt;/p&gt;&lt;p&gt;In  general, individual lines of PHP code should end with a semicolon,  although it is not necessary to use semicolons if a beginning or an  ending bracket is used (this will make sense when you look at if/then  statements).&lt;/p&gt;&lt;p&gt;For example:&lt;/p&gt;&lt;p&gt;&amp;lt;? &lt;/p&gt;&lt;p&gt;echo "&amp;lt;p&amp;gt;a line of code";&lt;/p&gt;&lt;p&gt;echo "&amp;lt;p&amp;gt;another line of code;&lt;/p&gt;&lt;p&gt;?&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60"&gt;&lt;param name="movie" value="http://www.studiesinn.com/banners/studiesinn.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;embed src="http://www.studiesinn.com/banners/studiesinn.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;var addthis_pub = "qasimbilal";&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="" border="0" height="16" width="125" /&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-1347313374798436220?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/1347313374798436220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/1347313374798436220'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/introduction.html' title='Introduction'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-2301897972321095713</id><published>2009-03-02T09:57:00.001-08:00</published><updated>2010-12-20T02:31:39.235-08:00</updated><title type='text'>Variables</title><content type='html'>Variables in PHP are denoted  by the "$". To assign the value "Hello World" to the variable $str, you  simply call it in your code:&lt;/p&gt;  &lt;p&gt;$str = "Hello World"; &lt;/p&gt;Strings must be enclosed by quotes, but they can contain variables themselves:&lt;br /&gt;&lt;p&gt;$a = 12; &lt;/p&gt;$string = "The value of a is $a";&lt;br /&gt;&lt;p&gt;// $string = "The Value of a is 12";&lt;/p&gt;PHP  variables do not have to be declared ahead of time, nor do they require  a type definition. Note that you may get a warning about using  undeclared variables if you try to use them before giving them a value  (depending on how you set up error reporting in php.ini). For example:&lt;br /&gt;&lt;p&gt;$a = 4; &lt;/p&gt;$c = $a + $b;&lt;br /&gt;&lt;p&gt;// $c = 4, but a warning appears "Warning: Undefined variable..".&lt;/p&gt;Warnings  do not stop a script from continuing. If you forgot to add a semicolon  at the end of one of the lines, then you would get a Parser error,  which prohibits the script from running.&lt;br /&gt; &lt;p&gt;Since  PHP variables are not typed, you don't have to worry about performing  mathematical equations on the wrong type, as you might in C. For  example:&lt;/p&gt;$a = 4;&lt;br /&gt;&lt;p&gt;$b = "5";&lt;/p&gt;$c = $a + $b;&lt;br /&gt;&lt;p&gt;// $c = 9;&lt;/p&gt;PHP also supports boolean variables, which can be assigned either a one or a zero, or the words true or false:&lt;br /&gt;&lt;p&gt;$a = true; &lt;/p&gt;$b = 1;&lt;br /&gt;&lt;p&gt;//$a = $b&lt;/p&gt;$c = false;&lt;br /&gt;&lt;p&gt;$d = 0;&lt;/p&gt;//$c = $d&lt;br /&gt;&lt;p&gt;&lt;br /&gt;  &lt;strong&gt;Variable Naming Rules&lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;A variable name must start with a letter or an underscore.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;  &lt;li&gt;A variable name can only contain alpha-numeric characters and underscores (a-Z, 0-9, and _ )&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;A  variable name should not contain spaces. If a variable name is more  than one word, it should be separated with underscore ($my_string), or  with capitalization ($myString)&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;p&gt;&lt;strong&gt;Comments:&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;You  can include comments in your PHP scripts. Comments are ignored by the  Web server, and any comments contained within the PHP code are not sent  to a browser. There are three forms of comments:&lt;/p&gt;&lt;p&gt;# Used just like it is used in PERL; comments out the remainder of the line after the # symbol.&lt;/p&gt;&lt;p&gt;// Used just like it is in JavaScript; comments out the remainder of the line after the // symbols.&lt;/p&gt;&lt;p&gt;/* and */— Comments out anything in between the two sets of symbols. This is the same syntax used in C to comment code.&lt;/p&gt;&lt;p&gt;Examples of comments in PHP code:&lt;/p&gt;&lt;p&gt;&amp;lt;? &lt;/p&gt;&lt;p&gt;echo "Hello"; #prints out "Hello"&lt;/p&gt;&lt;p&gt;echo "Hello"; //prints out "Hello"&lt;/p&gt;&lt;p&gt;/* The following&lt;/p&gt;&lt;p&gt;prints out "Hello" */&lt;/p&gt;&lt;p&gt;echo "Hello";&lt;/p&gt;&lt;p&gt;?&amp;gt;&lt;/p&gt;&lt;p&gt;You  will often see comments denoted using the // characters or the /* and  */ characters. The # character is rarely seen, although it is still  valid.&lt;/p&gt;&lt;p align="center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" height="60" width="468"&gt;&lt;param name="movie" value="http://www.studiesinn.com/banners/studiesinn.swf"&gt;&lt;param name="quality" value="high"&gt;&lt;embed src="http://www.studiesinn.com/banners/studiesinn.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" height="60" width="468"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;                                  &lt;script type="text/javascript"&gt;var addthis_pub = "qasimbilal";&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="" border="0" height="16" width="125" /&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-2301897972321095713?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/2301897972321095713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/2301897972321095713'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/variables.html' title='Variables'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-5673417538091674879</id><published>2009-03-02T09:55:00.000-08:00</published><updated>2010-12-20T02:32:02.380-08:00</updated><title type='text'>PHP Strings</title><content type='html'>String variables are used to store and manipulate a piece of text.&lt;/p&gt; &lt;br /&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;$msg="Hello World";&lt;br /&gt;&lt;br /&gt;echo $msg;&lt;br /&gt;&lt;p&gt;?&amp;gt;&lt;/p&gt;&lt;p&gt;The output will be&lt;/p&gt;&lt;p&gt;Hello World&lt;br /&gt;&lt;br /&gt; &lt;strong&gt;The Concatenation Operator&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;Dot (.) is used as concatenation operator. To concatenate two variables together, use the dot (.) operator:&lt;br /&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;$str1="Hello World";&lt;br /&gt;&lt;br /&gt;$str2="Adam";&lt;br /&gt;&lt;br /&gt;echo $ str1. " " . $ str2;&lt;br /&gt;&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Hello World Adam&lt;br /&gt;&lt;br /&gt; &lt;strong&gt;Length of a String:&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;The strlen() function is used to find the length of a string. &lt;/p&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;$string=”Hello World”;&lt;br /&gt;&lt;p&gt;echo strlen($string);&lt;/p&gt;&lt;p&gt;?&amp;gt;&lt;/p&gt;&lt;p&gt;Output will be&lt;/p&gt;&lt;p&gt;11&lt;/p&gt;&lt;p&gt;&lt;strong&gt;The strpos() function:&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;The strpos() function is used to search for a string or character within another string.&lt;br /&gt;&lt;br /&gt;If  the string is found in the string, this function will return the  position of the first match. If no match is found, it will return FALSE.&lt;br /&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;echo strpos("Example of strops function","of");&lt;br /&gt;&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The output will be&lt;/p&gt;&lt;p&gt;8&lt;/p&gt; &lt;p align="center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60"&gt;&lt;param name="movie" value="http://www.studiesinn.com/banners/studiesinn.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;embed src="http://www.studiesinn.com/banners/studiesinn.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;                                   &lt;script type="text/javascript"&gt;var addthis_pub = "qasimbilal";&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="" border="0" height="16" width="125" /&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-5673417538091674879?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/5673417538091674879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/5673417538091674879'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/php-strings.html' title='PHP Strings'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-4820998814196957795</id><published>2009-03-02T09:46:00.000-08:00</published><updated>2010-12-20T02:32:31.152-08:00</updated><title type='text'>Operators</title><content type='html'>Operators are used to  manipulate or perform operations on variables and values. There are  many operators used in PHP, we have separated them into the following  categories.&lt;br /&gt; &lt;ol&gt;&lt;li&gt;Assignment Operators&lt;br /&gt; &lt;/li&gt;&lt;br /&gt; &lt;li&gt;Arithmetic Operators&lt;br /&gt; &lt;/li&gt;&lt;br /&gt; &lt;li&gt;Comparison Operators&lt;br /&gt; &lt;/li&gt;&lt;br /&gt; &lt;li&gt;Logical Operators&lt;br /&gt; &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;p&gt;&lt;strong&gt;Assignment Operators:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Assignment  operators are used to set a variable equal to a value or set a variable  to another variable's value. ‘=’ is used for assignment operator.&lt;/p&gt;&lt;strong&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;$var = 23;&lt;br /&gt;&lt;br /&gt;$var2 = $var;&lt;br /&gt;&lt;br /&gt;&lt;table summary="" border="1" cellpadding="0" cellspacing="0" width="56%"&gt;&lt;tbody&gt; &lt;tr&gt;&lt;td valign="top" width="15%"&gt;&lt;strong&gt;Operator&lt;/strong&gt;&lt;/td&gt;&lt;td valign="top" width="39%"&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/td&gt;&lt;td valign="top" width="44%"&gt;&lt;strong&gt;Is The Same As&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;=&lt;/td&gt;&lt;td valign="top"&gt;a=b&lt;/td&gt;&lt;td valign="top"&gt;a=b&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;+=&lt;/td&gt;&lt;td valign="top"&gt;a+=b&lt;/td&gt;&lt;td valign="top"&gt;a=a+b&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;-=&lt;/td&gt;&lt;td valign="top"&gt;a-=b&lt;/td&gt;&lt;td valign="top"&gt;a=a-b&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;*=&lt;/td&gt;&lt;td valign="top"&gt;a*=b&lt;/td&gt;&lt;td valign="top"&gt;a=a*b&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;/=&lt;/td&gt;&lt;td valign="top"&gt;a/=b&lt;/td&gt;&lt;td valign="top"&gt;a=a/b&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;.=&lt;/td&gt; &lt;td valign="top"&gt;a.=b&lt;/td&gt;&lt;td valign="top"&gt;a=a.b&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;%=&lt;/td&gt;&lt;td valign="top"&gt;a%=b&lt;/td&gt;&lt;td valign="top"&gt;a=a%b&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;strong&gt;Arithmetic Operators:&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;table summary="" border="1" cellpadding="0" cellspacing="0" width="50%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign="top" width="27%"&gt;&lt;strong&gt;Operator&lt;/strong&gt;&lt;/td&gt;&lt;td valign="top" width="72%"&gt;&lt;strong&gt;Function&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;+&lt;/td&gt;&lt;td valign="top"&gt;Addition&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;-&lt;/td&gt;&lt;td valign="top"&gt;Subtraction&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;*&lt;/td&gt;&lt;td valign="top"&gt;Multiplication&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;/&lt;/td&gt;&lt;td valign="top"&gt;Division&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;%&lt;/td&gt;&lt;td valign="top"&gt;Modulus (division remainder)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;++&lt;/td&gt;&lt;td valign="top"&gt;Increment&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;--&lt;/td&gt;&lt;td valign="top"&gt;Decrement&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;strong&gt;Comparison Operators:&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;table summary="" border="1" cellpadding="0" cellspacing="0" width="442"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td valign="top"&gt;&lt;strong&gt;Operator&lt;/strong&gt;&lt;/td&gt;&lt;td valign="top"&gt;&lt;strong&gt;Function   &lt;/strong&gt;&lt;/td&gt;&lt;td valign="top"&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/td&gt;&lt;td valign="top"&gt;&lt;strong&gt;Result&lt;/strong&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;== &lt;/td&gt;&lt;td valign="top"&gt;Equal To&lt;/td&gt;&lt;td valign="top"&gt;$x == $y&lt;/td&gt;&lt;td valign="top"&gt;false&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;!= &lt;/td&gt;&lt;td valign="top"&gt;Not Equal To&lt;/td&gt;&lt;td valign="top"&gt;$x != $y&lt;/td&gt;&lt;td valign="top"&gt;true&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;&amp;lt;&lt;br /&gt;&lt;/td&gt;&lt;td valign="top"&gt;Less Than&lt;/td&gt;&lt;td valign="top"&gt;$x &amp;lt; $y &lt;/td&gt;&lt;td valign="top"&gt;true&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;&amp;gt;&lt;/td&gt;&lt;td valign="top"&gt;Greater Than&lt;/td&gt;&lt;td valign="top"&gt;$x &amp;gt; $y &lt;/td&gt;&lt;td valign="top"&gt;false&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&amp;lt;= &lt;/td&gt;&lt;td valign="top"&gt;Less Than or Equal To&lt;/td&gt;&lt;td valign="top"&gt;$x &amp;lt;= $y &lt;/td&gt;&lt;td valign="top"&gt;true&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;&amp;gt;= &lt;/td&gt;&lt;td valign="top"&gt;Greater Than or Equal To&lt;/td&gt;&lt;td valign="top"&gt;$x &amp;gt;= $y &lt;/td&gt;&lt;td valign="top"&gt;false&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;Logical Operators:&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;table summary="" border="1" cellpadding="0" cellspacing="0" width="59%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign="top" width="15%"&gt;&lt;strong&gt;Operator&lt;/strong&gt;&lt;/td&gt;&lt;td valign="top" width="40%"&gt;&lt;strong&gt;Function&lt;/strong&gt;&lt;/td&gt;&lt;td valign="top" width="45%"&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top"&gt;&amp;amp;&amp;amp;&lt;/td&gt;&lt;td valign="top"&gt;and&lt;/td&gt;&lt;td valign="top"&gt;x=8 y=4&lt;br /&gt;(x &amp;lt; 10 &amp;amp;&amp;amp; y &amp;gt; 1) returns true&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;||&lt;/td&gt;&lt;td valign="top"&gt;or&lt;/td&gt; &lt;td valign="top"&gt;x=12&lt;br /&gt;y=8&lt;br /&gt;(x&amp;gt;=5 || y&amp;lt;=5) returns true&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top"&gt;!&lt;/td&gt;&lt;td valign="top"&gt;not&lt;/td&gt;&lt;td valign="top"&gt;x=6&lt;br /&gt;y=3&lt;br /&gt;!(x==y) returns true&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;                                   &lt;p align="center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60"&gt;&lt;param name="movie" value="http://www.studiesinn.com/banners/studiesinn.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;embed src="http://www.studiesinn.com/banners/studiesinn.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;var addthis_pub = "qasimbilal";&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="" border="0" height="16" width="125" /&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-4820998814196957795?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/4820998814196957795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/4820998814196957795'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/operators.html' title='Operators'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-4869342693104948252</id><published>2009-03-02T09:43:00.001-08:00</published><updated>2010-12-20T02:32:48.697-08:00</updated><title type='text'>If…Else Statement</title><content type='html'>One of the most common PHP  language constructs that you will encounter is the if…then statement.  The if…then statement allows you to evaluate an expression and then,  depending if it is true or not, take a course of action. For example:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;$x = 1; &lt;/p&gt;if($x) {&lt;br /&gt;&lt;p&gt;      echo "True!";&lt;/p&gt;}&lt;br /&gt;&lt;p&gt;Since  $x = 1, then PHP interprets it in the context of the if statement to be  a boolean type. Since 1 = true, the if statements prints out the  message. Literally you can read it as "If True, then print out "True!".&lt;/p&gt;Another example, but this time with an "else" clause:&lt;br /&gt;&lt;p&gt;$a = 5; &lt;/p&gt;$b = "10";&lt;br /&gt;&lt;p&gt;if($a &amp;gt; $b) {&lt;/p&gt;    echo "$a is greater than $b";&lt;br /&gt;&lt;p&gt;} else {&lt;/p&gt;    echo "$a is not greater than $b";&lt;br /&gt;&lt;p&gt;}&lt;/p&gt;&lt;br /&gt;PHP  doesn't care that $a is an integer and $b is a string. It recognizes  that $b also makes a pretty good integer as well. It then evaluates the  expression, "If $a is greater than $b then print out that $a is greater  than $b; if not (else) then print out $a is not greater than $b." It's  also important to note that you don't say, "$a is less than $b," since  it is possible that $a could be equal to $b. If that is the case, then  the second part of the expression, the else statement, is the part that  runs.&lt;br /&gt;&lt;p&gt;Note the use of brackets to enclose the actions. Also note the lack of semicolons where the brackets are used.&lt;/p&gt;One final example is the if…elseif…else statement:&lt;br /&gt;&lt;p&gt;if($a == $b) { &lt;/p&gt;    // do something&lt;br /&gt;&lt;p&gt;} elseif ($a &amp;gt; $b) {&lt;/p&gt;    // do something else&lt;br /&gt;&lt;p&gt;} elseif($a &amp;lt; $b) {&lt;/p&gt;    // do yet something else&lt;br /&gt;&lt;p&gt;} else  {&lt;/p&gt;    // if nothing else we do this...&lt;br /&gt;&lt;p&gt;}&lt;/p&gt;&lt;span style="font-weight: bold;"&gt;Switch Statement:&lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;The  Switch statement is used to perform one of several different actions  based on one of several different conditions. Switch statements allow  for additional evaluations of the data, even though one of the cases  may have been met. Switch statements can also save you from typing many  if…elseif…elseif… statements.&lt;br /&gt;&lt;br /&gt;Syntax:&lt;br /&gt;&lt;br /&gt;switch (expression)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;case label1:&lt;br /&gt;&lt;br /&gt;  Statement(s);&lt;br /&gt;&lt;br /&gt;  break; &lt;br /&gt;&lt;br /&gt;case label2:&lt;br /&gt;&lt;br /&gt;  Statement(s);&lt;br /&gt;&lt;br /&gt;  break;&lt;br /&gt;&lt;br /&gt;default:&lt;br /&gt;&lt;br /&gt;  Statement(s);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Example:&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;$a = "100"; &lt;/p&gt;switch($a) {&lt;br /&gt;&lt;p&gt;    case(10):&lt;/p&gt;      echo "The value is 10";&lt;br /&gt;&lt;p&gt;      break;&lt;/p&gt;    case (100):&lt;br /&gt;&lt;p&gt;      echo "The value is 100&amp;lt;br&amp;gt;";&lt;/p&gt;    case (1000):&lt;br /&gt;&lt;p&gt;      echo "The value is 1000";&lt;/p&gt;      break;&lt;br /&gt;&lt;p&gt;    default:&lt;/p&gt;      echo "&amp;lt;p&amp;gt;Wrong Input";&lt;br /&gt;&lt;p&gt;}&lt;/p&gt;&lt;span style="font-weight: bold;"&gt;switch statements have four basic parts:&lt;/span&gt;&lt;br /&gt; &lt;ol&gt;&lt;li&gt;The  switch— The switch identifies what value or expression is going to be  evaluated in each of the cases. In the example above, you tell the  switch statement that you are going to evaluate the variable $a in the  subsequent cases.&lt;/li&gt;&lt;br /&gt; &lt;li&gt;The  case— The case statement evaluates the variable you passed from the  switch command. You can use case() the same way you'd use an if  statement. If the case holds true, then everything after the case  statement is executed, until the parser encounters a break command, at  which point execution stops and the switch is exited.&lt;/li&gt;&lt;br /&gt; &lt;li&gt;Breakpoints—  Defined by the break command, exit the parser from the switch.  Breakpoints are normally put after statements executed when a case() is  met.&lt;/li&gt;&lt;br /&gt; &lt;li&gt;Default— The  default is a special kind of case. It is executed if none of the other  case statements in the switch have been executed.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;p align="center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60"&gt;&lt;param name="movie" value="http://www.studiesinn.com/banners/studiesinn.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;embed src="http://www.studiesinn.com/banners/studiesinn.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;         &lt;br /&gt;&lt;br /&gt;                           &lt;script type="text/javascript"&gt;var addthis_pub = "qasimbilal";&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="" border="0" height="16" width="125" /&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-4869342693104948252?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/4869342693104948252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/4869342693104948252'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/ifelse-statement.html' title='If…Else Statement'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-2997491030663009195</id><published>2009-03-02T09:42:00.001-08:00</published><updated>2010-12-20T02:33:11.314-08:00</updated><title type='text'>PHP Loops</title><content type='html'>Loops are used to repeat  statement or block of statement more than one time. The idea of a loop  is to do something over and over again until the task has been  completed.&lt;br /&gt;&lt;p&gt;In PHP we have the following looping statements:&lt;br /&gt;&lt;br /&gt; &lt;strong&gt;For &lt;/strong&gt;&lt;strong&gt;Loop&lt;/strong&gt;&lt;strong&gt;:&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;For loops are useful constructions to loop through a finite set of data, such as data in an array. &lt;/p&gt;&lt;strong&gt;Syntax:&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;for ( initialization; conditional statement; increment/decrement){&lt;br /&gt;&lt;br /&gt;            statement(s);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt; &lt;ol&gt;&lt;li&gt;Initialization—You can pass in an already assigned variable or assign a value to the variable in the for statement.&lt;/li&gt;&lt;br /&gt; &lt;li&gt;The condition required to continue the for loop— The statements are executed until the given condition goes false.&lt;/li&gt;&lt;br /&gt; &lt;li&gt;Statement to modify the counter on each pass of the loop.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;strong&gt;Example:&lt;br /&gt;&lt;/strong&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;for ($i=1; $i&amp;lt;=10; $i++)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;  echo "Hello World&amp;lt;br /&amp;gt;";&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;p&gt;?&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;strong&gt;Foreach Loop: &lt;/strong&gt;&lt;br /&gt;&lt;p&gt;Foreach loops allow you to quickly traverse through an array.&lt;/p&gt;&lt;p&gt;$array = array("name" =&amp;gt; "Jet", "occupation" =&amp;gt; "Bounty Hunter" ); &lt;/p&gt;&lt;p&gt;foreach ($array as $val) {&lt;/p&gt;&lt;p&gt;    echo "&amp;lt;P&amp;gt;$val";&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;br /&gt;&lt;strong&gt;Prints out:&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;P&amp;gt;Jet&lt;/p&gt;&lt;p&gt;&amp;lt;P&amp;gt;Bounty Hunter&lt;/p&gt;&lt;p&gt;You can also use foreach loops to get the key of the values in the array:&lt;/p&gt;&lt;p&gt;foreach ($array as $key =&amp;gt; $val) { &lt;/p&gt;&lt;p&gt;    echo "&amp;lt;P&amp;gt;$key : $val";&lt;/p&gt;&lt;p&gt;}&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt; &lt;strong&gt;Prints out:&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&amp;lt;P&amp;gt;name : Jet&lt;/p&gt;&lt;p&gt;&amp;lt;P&amp;gt;occupation : Bounty Hunter&lt;/p&gt;&lt;strong&gt;While &lt;/strong&gt;&lt;strong&gt;Loop&lt;/strong&gt;&lt;strong&gt;:&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;While  loops are another useful construct to loop through data. While loops  continue to loop until the expression in the while loop evaluates to  false. A common use of the while loop is to return the rows in an array  from a result set. The while loop continues to execute until all of the  rows have been returned from the result set.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Syntax:&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;while (condition){&lt;br /&gt;&lt;br /&gt;statement(s);&lt;br /&gt;&lt;/p&gt;&lt;p&gt;}&lt;br /&gt; &lt;strong&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;$i=1;&lt;br /&gt;&lt;br /&gt;while($i&amp;lt;=9)&lt;br /&gt;&lt;br /&gt;  {&lt;br /&gt;&lt;br /&gt;  echo "The number is " . $i . "&amp;lt;br /&amp;gt;";&lt;br /&gt;&lt;br /&gt;  $i++;&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;&lt;/p&gt;&lt;p&gt;?&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Do-While Loop:&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Do  while loops are another useful loop construct. Do while loops work  exactly the same as normal while loops, except that the script  evaluates the while expression after the loop has completed, instead of  before the loop executes, as in a normal while loop.&lt;/p&gt;&lt;p&gt;The  important difference between a do while loop and a normal while loop is  that a do while loop is always executed at least once. A normal while  loop may not be executed at all, depending on the expression. The  following do while loop is executed one time, printing out $i to the  screen:&lt;/p&gt;&lt;p&gt;$i = 0; &lt;/p&gt;&lt;p&gt;do {&lt;/p&gt;&lt;p&gt;   print $i;&lt;/p&gt;&lt;p&gt;} while ($i&amp;gt;0);&lt;/p&gt;&lt;p&gt;Whereas the following is not executed at all:&lt;/p&gt;&lt;p&gt;$i = 0; &lt;/p&gt;&lt;p&gt;while($i &amp;gt; 0)  {&lt;/p&gt;&lt;p&gt;print $i;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;strong&gt;Arrays:&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;An  array is a data structure that stores one or more values in a single  value. PHP supports both numerical arrays (array items are indexed by  their numerical order) as well as associative arrays (array items are  indexed by named keys).&lt;/p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;$a = array(1, 2, 3, 4); &lt;/p&gt;&lt;p&gt;//$a[0] = 1&lt;/p&gt;&lt;p&gt;//$a[1] = 2&lt;/p&gt;&lt;p&gt;//$a[2] = 3&lt;/p&gt;&lt;p&gt;//$a[3] = 4&lt;/p&gt;&lt;p&gt;$b = array("name"=&amp;gt;"Fred", "age" =&amp;gt; 30);&lt;/p&gt;&lt;p&gt;//$b['name'] = "Fred"&lt;/p&gt;&lt;p&gt;//$b['age'] = 30&lt;/p&gt;    &lt;p align="center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60"&gt;&lt;param name="movie" value="http://www.studiesinn.com/banners/studiesinn.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;embed src="http://www.studiesinn.com/banners/studiesinn.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;     &lt;br /&gt;&lt;br /&gt;                           &lt;script type="text/javascript"&gt;var addthis_pub = "qasimbila&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="" border="0" height="16" width="125" /&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-2997491030663009195?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/2997491030663009195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/2997491030663009195'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/php-loops.html' title='PHP Loops'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-1376431679279088653</id><published>2009-03-02T09:40:00.000-08:00</published><updated>2010-12-20T02:33:29.543-08:00</updated><title type='text'>PHP Functions</title><content type='html'>In addition to PHP's built-in  functions, you can create your own functions. Remember that if you want  to use variables that exist outside of the function, then you must  declare them as global variables or assign them as arguments to the  function itself&lt;/p&gt;&lt;p&gt;function check_age($age) { &lt;/p&gt;&lt;p&gt;    if ($age &amp;gt; 21) {&lt;/p&gt;&lt;p&gt;        return 1;&lt;/p&gt;&lt;p&gt;    } else {&lt;/p&gt;&lt;p&gt;        return 0;&lt;/p&gt;&lt;p&gt;    }&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;//usage:&lt;/p&gt;&lt;p&gt;if(check_age($age)) {&lt;/p&gt;&lt;p&gt;    echo "You may enter!";&lt;/p&gt;&lt;p&gt;} else {&lt;/p&gt;&lt;p&gt;    echo "Access Not Allowed!";&lt;/p&gt;&lt;p&gt;    exit();&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;The function would be called from within your script at the appropriate time, using the following syntax:&lt;/p&gt;&lt;p&gt;$age = 10; &lt;/p&gt;&lt;p&gt;check_age($age);&lt;br /&gt;&lt;br /&gt; &lt;strong&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;function simpletable($text) {&lt;br /&gt;&lt;br /&gt;  print("&amp;lt;table border=0 cellpadding=0 cellspacing=0&amp;gt;&amp;lt;tr&amp;gt;");&lt;br /&gt;&lt;br /&gt;  print("&amp;lt;td&amp;gt;$text&amp;lt;/td&amp;gt;");&lt;br /&gt;&lt;br /&gt;  print("&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;"); &lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;phpinfo( )&lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;phpinfo()  is a very useful function that allows you to see what version of PHP is  running on your Web server, as well as all of the specific settings  that are enabled in that version.&lt;/p&gt;&lt;p&gt;&amp;lt;? &lt;/p&gt;&lt;p&gt;    phpinfo();&lt;/p&gt;&lt;p&gt;?&amp;gt;&lt;/p&gt;    &lt;p align="center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60"&gt;&lt;param name="movie" value="http://www.studiesinn.com/banners/studiesinn.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;embed src="http://www.studiesinn.com/banners/studiesinn.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;                                &lt;script type="text/javascript"&gt;var addthis_pub = "qasimbilal";&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="" border="0" height="16" width="125" /&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-1376431679279088653?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/1376431679279088653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/1376431679279088653'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/php-functions.html' title='PHP Functions'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-3666523580735429058</id><published>2009-03-02T09:39:00.000-08:00</published><updated>2010-12-20T02:34:30.602-08:00</updated><title type='text'>PHP Forms</title><content type='html'>Forms are the most fundamental  method of interaction for your users. Users must use a form to enter  information into a site. Think about it, every bulletin board, shopping  cart, feedback form, and poll is a type of form. Without forms, the Web  is nothing more than a publishing medium for those who can FTP Web  pages up to a server.&lt;br /&gt;&lt;strong&gt;GET &amp;amp; POST Methods:&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;There are two methods that you can use when creating a form in HTML. They are post and get, as in:&lt;/p&gt;&amp;lt;form action=”saveinfo.php” method=post&amp;gt;&lt;br /&gt;&lt;p&gt;or:&lt;/p&gt;&amp;lt;form action=”saveinfo.php” method=get&amp;gt;&lt;br /&gt;&lt;p&gt;If  you don't specify a method, then the Web server assumes that you are  using the get method. So what's the deal? They do the same thing right?  Well, almost. You may have noticed that the URL looks a lot longer  after you submit a form that uses the get method. For example, you may  see something like:&lt;/p&gt;http://studiesinn.com/form.php?name=fred&amp;amp;age=20&amp;amp;comments=This+site+rocks&lt;br /&gt;&lt;p&gt;&lt;br /&gt;That's  because the get method puts the contents of the form right in the URL.  There are a few disadvantages to this. First, depending on your Web  server's operating system and software, there is a limit to how much  data you can send through a form using the get method. On many systems,  this limit is 256 characters. Also, the individual get queries may be  stored in your Web server logs. If you are using space on a shared  server, then other people may be able to decipher data sent from your  forms that use the get method.&lt;/p&gt;The  post method was created to correct the inadequacies of the get method.  The information sent using the post method is not visible in the URL,  and form data cannot be deciphered by looking in the Web server logs.  There also isn't such a small limit on the amount of data that can be  sent from a form. Again, it depends on your server, but you probably  won't ever hit the limit of sending data using the post method for a  text-based form.&lt;br /&gt;&lt;p&gt;I  use the post method for my scripts unless I need to debug something.  When you need to debug something on a form, it is easy enough to switch  to the get method (by changing the action line in your script) and then  check the URL after you submit your buggy form. You can usually pick up  typos and such with a quick look.&lt;br /&gt;&lt;strong&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&amp;lt;form action="display.php" method="get"&amp;gt;&lt;br /&gt;&lt;br /&gt;Name: &amp;lt;input type="text" name="name" /&amp;gt;&lt;br /&gt;&lt;br /&gt;Age: &amp;lt;input type="text" name="age" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;input type="submit" /&amp;gt;&lt;br /&gt;&lt;/p&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;p&gt;When you click the "Submit" button on the form the URL sent could look something like this:&lt;br /&gt;&lt;br /&gt; http://www.studiesinn.com/display.php?name=adam&amp;amp;age=22&lt;br /&gt;&lt;br /&gt;On display.php page you can retrieve the value by using the following code&lt;br /&gt;&lt;br /&gt;Welcome &amp;lt;?php echo $_GET["name"]; ?&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;br /&gt;You are &amp;lt;?php echo $_GET["age"]; ?&amp;gt; years old!&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The $_REQUEST Variable:&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;The PHP $_REQUEST variable can be used as the replacement of  $_GET,  $_POST, and $_COOKIE. The $_REQUEST variable can be used to get the  result from form data sent with both the GET and POST methods.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;br /&gt;&lt;br /&gt;&amp;lt;form action="display.php" method="post"&amp;gt;&lt;br /&gt;&lt;br /&gt;Enter your name: &amp;lt;input type="text" name="name" /&amp;gt;&lt;br /&gt;&lt;br /&gt;Enter your age: &amp;lt;input type="text" name="age" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;input type="submit" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;/p&gt;When you click the Submit button on the form, following URL will be sent.&lt;br /&gt;&lt;p&gt;http://www.studiesinn.com/display.php&lt;/p&gt;&lt;p&gt;On display.php page you can retrieve the value as&lt;/p&gt;&lt;p&gt;Welcome &amp;lt;?php echo $_POST["name"]; ?&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;br /&gt; You are &amp;lt;?php echo $_POST["age"]; ?&amp;gt; years old!&lt;br /&gt;&lt;/p&gt;    &lt;p align="center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60"&gt;&lt;param name="movie" value="http://www.studiesinn.com/banners/studiesinn.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;embed src="http://www.studiesinn.com/banners/studiesinn.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;                                &lt;script type="text/javascript"&gt;var addthis_pub = "qasimbilal";&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="" border="0" height="16" width="125" /&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-3666523580735429058?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/3666523580735429058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/3666523580735429058'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/php-forms.html' title='PHP Forms'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-7141905039277663984</id><published>2009-03-02T09:38:00.001-08:00</published><updated>2010-12-20T02:34:46.515-08:00</updated><title type='text'>PHP Sessions</title><content type='html'>You cannot track variables across a user session unless you start the session on each page on which you want to use or alter those  variables. Starting a session uses the session_start() function:&lt;/p&gt;&lt;p&gt;session_start(); &lt;/p&gt;session_start()  takes no arguments. If you are starting a new session, then the  function initializes the session and creates the necessary temp files  to track the session. If a $PHPSESSID is found by the function, either  by a cookie or a GET variable, then the function resumes the current  session and the page has access to any variables that have been  registered to the session.&lt;br /&gt;&lt;p&gt;Once  you have started the session, you need to register some variables with  it. The session will not track variables until they have been  registered using the session_register() function:&lt;/p&gt;session_register(STRING);&lt;br /&gt;&lt;p&gt;&lt;br /&gt;The  STRING argument to session_register() should be the name of the  variable that you want to register with the session so that it may be  accessed across any session-enabled pages.&lt;/p&gt;Once  you have started the session and registered one or more variables, you  can use those variables across any session enabled pages on your site.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;?&lt;/p&gt;&lt;p&gt;session_start();&lt;/p&gt;&lt;p&gt;if(!isset($count)) {&lt;/p&gt;&lt;p&gt;session_register("count");&lt;/p&gt;&lt;p&gt;     $count = 1;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;?&amp;gt;&lt;/p&gt;&lt;p&gt;You have been to this page &amp;lt;?=$count?&amp;gt; times.&lt;/p&gt;&lt;p&gt;&amp;lt;?&lt;/p&gt;&lt;p&gt;$count++;&lt;/p&gt;&lt;p&gt;?&amp;gt;&lt;strong&gt;&lt;br /&gt;&lt;br /&gt; Destroying Sessions:&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;There  are two ways to combat the buildup of files in your temporary directory  that will not, in most cases, adversely affect your users' sessions.&lt;/p&gt;&lt;p&gt;The first is to make use of the session_destroy() function:&lt;/p&gt;&lt;p&gt;session_destroy(); &lt;/p&gt;&lt;p&gt;session_destroy()  takes no arguments. session_destroy() unregisters all session variables  associated with the user session and removes any session files created  by the session. Remember that even if a variable is unregistered with a  session, the variable still exists with its value intact on the current  page.&lt;/p&gt;     &lt;p align="center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60"&gt;&lt;param name="movie" value="http://www.studiesinn.com/banners/studiesinn.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;embed src="http://www.studiesinn.com/banners/studiesinn.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;                               &lt;script type="text/javascript"&gt;var addthis_pub = "qasimbilal";&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="" border="0" height="16" width="125" /&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-7141905039277663984?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/7141905039277663984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/7141905039277663984'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/php-sessions.html' title='PHP Sessions'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-8891774793872714131</id><published>2009-03-02T09:36:00.000-08:00</published><updated>2010-12-20T02:34:59.290-08:00</updated><title type='text'>PHP Cookies</title><content type='html'>A cookie is a small bit of  information stored on a viewer's computer by his or her web browser by  request from a web page. The information is constantly passed in HTTP  headers between the browser and web server; the browser sends the  current cookie as part of its request to the server and the server  sends updates to the data back to the user as part of its response. In  addition to the information it stores, each cookie has a set of  attributes: an expiration date, a valid domain, a valid domain path and  an optional security flag. These attributes help ensure the browser  sends the correct cookie when a request is made to a server.&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Syntax:&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;setcookie(name, value, expire, path, domain);&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;setcookie("c_name", "Adam", time()+60);&lt;br /&gt;&lt;p&gt;?&amp;gt;&lt;strong&gt;&lt;br /&gt;&lt;br /&gt; Retrieve a Cookie:&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;The $_COOKIE variable is used to retrieve a cookie. &lt;/p&gt;&lt;p&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt; echo $_COOKIE["user"];&lt;/p&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;         &lt;p align="center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60"&gt;&lt;param name="movie" value="http://www.studiesinn.com/banners/studiesinn.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;embed src="http://www.studiesinn.com/banners/studiesinn.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;                          &lt;script type="text/javascript"&gt;var addthis_pub = "qasimbilal";&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="" border="0" height="16" width="125" /&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-8891774793872714131?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/8891774793872714131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/8891774793872714131'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/php-cookies.html' title='PHP Cookies'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-8083974098252298491</id><published>2009-03-02T09:35:00.001-08:00</published><updated>2010-12-20T02:35:18.725-08:00</updated><title type='text'>PHP Files</title><content type='html'>PHP is a very useful language  for working with files. Although it may not be as robust as other  languages, such as PERL, when it comes to parsing files, PHP still  provides great power and flexibility when it comes to working with text  files.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Opening a File:&lt;/strong&gt;&lt;br /&gt;Before you can use PHP to read a file, you must first open it. To open a file, you use the fopen() function.&lt;/p&gt;&lt;p&gt;$file_handler = fopen($file, $mode) &lt;/p&gt;&lt;p&gt;You  must assign the function to a variable, as above. This is referred to  as a file pointer. You use the file pointer to reference the open file  throughout your script.&lt;/p&gt;&lt;p&gt;The fopen() function takes two arguments:&lt;br /&gt; &lt;/p&gt;&lt;ul&gt;&lt;li&gt;$file is the name (and path, if required) of the file.&lt;/li&gt;&lt;br /&gt; &lt;li&gt;$mode is one of a list of available modes:&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;1.        r— Open the file as read-only. You cannot write anything to the file. Reading begins at the beginning of the file.&lt;br /&gt;&lt;p&gt;2.        r+  — Open the file for reading and writing. Reading and writing begin at  the beginning of the file. You will delete existing contents if you  write to the file without first moving the internal pointer to the end  of the file.&lt;/p&gt;3.        w—  Open the file for write-only. You cannot read data from the file.  Writing begins at the beginning of the file. You will again delete  contents if you write to the file without first moving the pointer to  the end of the file. If the file specified by the $fie argument does  not exist, then PHP attempts to create the file. Make sure your  permissions are set correctly!&lt;br /&gt;&lt;p&gt;4.        w+ — As above, but the file may also be read.&lt;/p&gt;5.        a—  This mode is the same as the 'w' mode, with the exception that the  internal pointer is placed at the end of the file. Existing contents  will not be overwritten unless you rewind the internal pointer to the  beginning of the file.&lt;br /&gt;&lt;p&gt;6.        a+ — As above, but the file may also be read.&lt;/p&gt;Additionally,  if the file is a binary file, you must include a "b" in the mode if  your OS is Windows. This chapter only deals with ASCII text files, so  you will not require the "b: mode in the following example. If you do  need to open a binary file, an example is below:&lt;br /&gt;&lt;p&gt;$file_handle = fopen($filename, "rb+") &lt;/p&gt;Note  the differences between the "w" and "a" modes. Using "w" to open a file  effectively deletes the contents of the file, while using the "a" mode  retains the contents of the file and allows you to append additional  data to the end of the file.&lt;br /&gt;&lt;p&gt;Once you have the file opened, you can then read from or write to the file.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Reading a File: &lt;/strong&gt;&lt;p&gt;&lt;br /&gt;There are multiple functions available to read from a file.&lt;br /&gt;&lt;br /&gt;You can read data from the file using the fread() function:&lt;br /&gt;&lt;br /&gt;$file_contents = fread($file_pointer, $length_to_read); &lt;br /&gt;&lt;br /&gt;You  must assign the value of fread() to a variable, which will contain the  data that has been read. The fread() function takes two arguments:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $file_pointer is the file pointer to which you assigned the value from the fopen() function.&lt;br /&gt;&lt;br /&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $length is the amount of bytes that you wish to read.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;When  using fread() to read a file, you can read in the entire file. To do  this, you need to know the byte-size of the file. You can easily find  the total byte-size of a file using the filesize() function:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;$bytes = filesize($filename); &lt;/p&gt;&lt;br /&gt;&lt;p&gt;The following script demonstrates how to open a short text file and display its contents:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;$file = &amp;quot;/path/to/text.txt&amp;quot;; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;$filepointer = fopen($file, &amp;quot;r&amp;quot;);&lt;/p&gt;&lt;br /&gt;&lt;p&gt;$contents = fread($filepointer, filesize($file));&lt;/p&gt;&lt;br /&gt;&lt;p&gt;echo &amp;quot;&amp;lt;pre&amp;gt;&amp;quot; . htmlentities($contents) . &amp;quot;&amp;lt;/pre&amp;gt;&amp;quot;;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Closing a File:&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;When  you have finished reading from or writing to a file that has been  opened using the fopen() function, you should always close it using the  fclose() function:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;fclose($filepointer); &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Closing  the file allows you to clean up any memory that was used to open it and  also prevents possible file corruption that sometimes (rarely) occurs  when a file is left open.&lt;/p&gt;&lt;p align="center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60"&gt;&lt;param name="movie" value="http://www.studiesinn.com/banners/studiesinn.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;embed src="http://www.studiesinn.com/banners/studiesinn.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;                                   &lt;script type="text/javascript"&gt;var addthis_pub = "qasimbilal";&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="" border="0" height="16" width="125" /&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"&gt;&lt;/script&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-8083974098252298491?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/8083974098252298491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/8083974098252298491'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/php-files.html' title='PHP Files'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-3946883944601890092</id><published>2009-03-02T09:31:00.001-08:00</published><updated>2010-12-20T02:35:32.305-08:00</updated><title type='text'>E-mail</title><content type='html'>&gt;mail() function is used to send emails from inside a script in php. The Syntax of mail() function is as under.mail(to,subject,message,headers,parameters)&lt;br /&gt;&lt;/p&gt;&lt;table summary="" border="1" cellpadding="0" cellspacing="0" width="440"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td valign="top" width="70"&gt;&lt;strong&gt;Parameter&lt;/strong&gt;&lt;/td&gt;&lt;td valign="top" width="674"&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;to&lt;/td&gt;&lt;td valign="top"&gt;Required. Specifies the receivers email&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;subject&lt;/td&gt;&lt;td valign="top"&gt;Required. Specifies the subject of the email&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;message&lt;/td&gt;&lt;td valign="top"&gt;Required.  Contain the message to be sent. Each line should be separated with a  Line Fed (\n). Lines should not exceed 70 characters&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;headers&lt;/td&gt;&lt;td valign="top"&gt;Optional. Specifies additional headers, like From, Cc, and Bcc. The additional headers should be separated with a CRLF (\r\n)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;parameters&lt;/td&gt;&lt;td valign="top"&gt;Optional. Specifies an additional parameter to the sendmail program.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;&amp;lt;?php&lt;br /&gt;$to      = 'noname@testing.com';&lt;br /&gt;&lt;br /&gt;$subject = 'E-mail subject';&lt;br /&gt;&lt;br /&gt;$message = 'E-mail message';&lt;br /&gt;&lt;br /&gt;$headers = 'From: webmaster@studiesinn.com' . "\r\n" .&lt;br /&gt;&lt;br /&gt;    'Reply-To: webmaster@ webmaster.com' . "\r\n" .&lt;br /&gt;&lt;br /&gt;    'X-Mailer: PHP/' . phpversion();&lt;br /&gt;&lt;br /&gt;mail($to, $subject, $message, $headers);&lt;br /&gt;&lt;br /&gt;?&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;p align="center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60"&gt;&lt;param name="movie" value="http://www.studiesinn.com/banners/studiesinn.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;embed src="http://www.studiesinn.com/banners/studiesinn.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;var addthis_pub = "qasimbilal";&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="" border="0" height="16" width="125" /&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-3946883944601890092?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/3946883944601890092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/3946883944601890092'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/e-mail.html' title='E-mail'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-7369153006637533846</id><published>2009-03-02T09:28:00.000-08:00</published><updated>2010-12-20T02:35:49.201-08:00</updated><title type='text'>Error Handling</title><content type='html'>Error handling is the process of changing the control flow of a program in response to error conditions. Error conditions can be caused by a variety of factors - programmer error, corrupt input data, software requirements deficiencies and in many other conditions.&lt;br /&gt;&lt;br /&gt;A web application needs to be able to gracefully handle all of these potential problems - recovering from them where possible and exiting gracefully when the error is fatal.&lt;br /&gt;&lt;br /&gt;We will show different error handling methods:&lt;br /&gt;&lt;br /&gt;   1. Simple "die()" statements&lt;br /&gt;&lt;br /&gt;   2. Custom errors and error triggers&lt;br /&gt;&lt;br /&gt;   3. Error reporting&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Simple die() statement:&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;&lt;br /&gt;if(!file_exists("myfile.txt"))&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;die("File not found");&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;else&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;$file=fopen("myfile.txt","r");&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If the file does not exist you get an error message like this:&lt;br /&gt;&lt;br /&gt;File not found&lt;br /&gt;&lt;br /&gt;Custom errors and error triggers&lt;br /&gt;&lt;br /&gt;You can create a custom error handler in PHP to replace the standard output to the browser. First you set up the error handler to replace the normal one, and set the ini values.&lt;br /&gt;&lt;br /&gt;ini_set('display_errors', 'Off');&lt;br /&gt;&lt;br /&gt;ini_set('log_errors', 'On');&lt;br /&gt;&lt;br /&gt;define('ERROR_LOG_PATH', 'error_log.txt');&lt;br /&gt;&lt;br /&gt;set_error_handler("custom_err_handler");&lt;br /&gt;&lt;br /&gt;The custom function is defined we must then create it. The function takes 4 arguments.&lt;br /&gt;&lt;br /&gt;   1. $num: level of the error raised&lt;br /&gt;   2. $str: contains the error message&lt;br /&gt;   3. $file: filename that the error was raised in&lt;br /&gt;   4. $line: line number the error was raised at&lt;br /&gt;&lt;br /&gt;function custom_err_handler($num, $str, $file, $line) {&lt;br /&gt;&lt;br /&gt;print "Error Handler Called!";&lt;br /&gt;&lt;br /&gt;$err = "";&lt;br /&gt;&lt;br /&gt;$err .= "PHP Error\n";&lt;br /&gt;&lt;br /&gt;$err .= "Number: [" . $num . "]\n";&lt;br /&gt;&lt;br /&gt;$err .= "String: [" . $str . "]\n";&lt;br /&gt;&lt;br /&gt;$err .= "File: [" . $file . "]\n";&lt;br /&gt;&lt;br /&gt;$err .= "Line: [" . $line . "]\n\n";&lt;br /&gt;&lt;br /&gt;error_log($err, 3, ERROR_LOG_PATH);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function Errfunction() {&lt;br /&gt;&lt;br /&gt;trigger_error("errror message");&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Now call the Errfunction()&lt;br /&gt;&lt;br /&gt;myFunction();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-7369153006637533846?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/7369153006637533846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/7369153006637533846'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/error-handling.html' title='Error Handling'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-1875072360949046353</id><published>2009-03-02T09:26:00.000-08:00</published><updated>2010-12-20T02:36:05.078-08:00</updated><title type='text'>File Upload</title><content type='html'>You must first build an HTML form that lets users select a file to upload.&lt;/p&gt;&lt;p&gt;&amp;lt;form enctype="multipart/form-data" action="uploadfile.php" method="POST"&amp;gt;&lt;br /&gt;&lt;br /&gt;Select file to upload: &amp;lt;input name="file" type="file" /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;input type="submit" value="Upload File" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;uploadfile.php code:&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;$target_path = "myfiles/";&lt;br /&gt;&lt;br /&gt;$target_path = $target_path . basename( $_FILES[‘file’]['name']);&lt;br /&gt;&lt;br /&gt;if(move_uploaded_file($_FILES[‘file’]['tmp_name'], $target_path)) {&lt;br /&gt;&lt;br /&gt;   echo "The file ".  basename( $_FILES[‘file’]['name'])." has been uploaded";&lt;br /&gt;&lt;br /&gt;} else{&lt;br /&gt;&lt;br /&gt;   echo "Error Uploading File, Please try again.";&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;$_FILES['file']['name']&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;It contains the original path of the user uploaded file.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;$_FILES['file']['tmp_name'] &lt;/strong&gt;&lt;/p&gt;It  contains the path to the temporary file that resides on the server. The  file should exist on the server in a temporary directory with a  temporary name.&lt;br /&gt;&lt;p&gt;&lt;strong&gt;The include() Function:&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;The include() function takes all the text in a specified file and copies it into the file that uses the include function.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;?php include("header.php"); ?&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;Welcome to The Home Page&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p align="center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60"&gt;&lt;param name="movie" value="http://www.studiesinn.com/banners/studiesinn.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;embed src="http://www.studiesinn.com/banners/studiesinn.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;var addthis_pub = "qasimbilal";&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="" border="0" height="16" width="125" /&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-1875072360949046353?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/1875072360949046353'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/1875072360949046353'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/file-upload.html' title='File Upload'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-5190836870479454971</id><published>2009-03-02T09:25:00.001-08:00</published><updated>2010-12-20T02:36:17.849-08:00</updated><title type='text'>PHP Databases</title><content type='html'>A database is a collection  of data that is stored independently of the manner in which you collect  it or may wish to retrieve it.  It is organized for efficient storage  and retrieval, based on the nature of the data, rather than the  collection or retrieval methods.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is MySQL&lt;br /&gt;&lt;/strong&gt;MySQL  is an open source relational database management system (RDBMS)that  uses Structured Query Language (SQL), the most popular language for  adding, accessing, and processing data in a database. It is a Database  Management System which is available for both Linux and Windows.&lt;br /&gt;&lt;p&gt;In a database, there are tables. Database tables contain rows, columns, and cells. Tables are used to organize and group your data by common characteristics or principles.&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;Database Query:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Database  Query is a form generator and query manager that works with any  database. Database Query automatically creates forms for selecting,  updating, inserting, or deleting data in MySQL, Oracle, DB2, or any  other database. With MySQL, we can query a database for specific  information and have a recordset returned.&lt;/p&gt;          &lt;p align="center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60"&gt;&lt;param name="movie" value="http://www.studiesinn.com/banners/studiesinn.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;embed src="http://www.studiesinn.com/banners/studiesinn.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;                          &lt;script type="text/javascript"&gt;var addthis_pub = "qasimbilal";&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="" border="0" height="16" width="125" /&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-5190836870479454971?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/5190836870479454971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/5190836870479454971'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/php-databases.html' title='PHP Databases'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-5298522733296079856</id><published>2009-03-02T09:24:00.001-08:00</published><updated>2010-12-20T02:37:21.077-08:00</updated><title type='text'>Connecting to a MySQL Database</title><content type='html'>In order to pull information from a MySQL database to your php pages, you need to connect to the database first.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Syntax&lt;/strong&gt;:&lt;br /&gt;mysql_connect(servername,username,password);&lt;br /&gt;&lt;strong&gt;servername:&lt;/strong&gt; It specifies the server to connect to. Default value is "localhost:3306"&lt;br /&gt;&lt;strong&gt;username:&lt;/strong&gt; It specifies the username to log in with. Default value is the name of the user that owns the server process&lt;br /&gt;&lt;strong&gt;password:&lt;/strong&gt; It specifies the password to login. Default is ""&lt;/p&gt;&lt;strong&gt;Note:&lt;br /&gt;&lt;/strong&gt;To  execute the SQL statements we must use the mysql_query() function. This  function is used to send a query or command to a MySQL connection.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Example:&lt;br /&gt;&lt;/strong&gt;&amp;lt;?php&lt;br /&gt;&lt;!--p &lt;br--&gt;$server = "localhost";&lt;br /&gt;$user = "";&lt;br /&gt;$pass = "";&lt;br /&gt;$db = "mydb";&lt;br /&gt;&lt;p&gt;$conn = mysql_connect("$host", "$user", "$pass") or die ("Unable to connect.");&lt;br /&gt;mysql_select_db("$db", $conn);&lt;/p&gt;?&amp;gt;&lt;br /&gt;&lt;strong&gt;Create a Database&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;PHP also provide a function to create MySQL database, mysql_create_db(). &lt;/p&gt;&lt;!--p&lt;br--&gt;$con = mysql_connect("localhost:3306","adam","123456");&lt;br /&gt;if (!$con)&lt;br /&gt;  {&lt;br /&gt;  die('Could not connect: ' . mysql_error());&lt;br /&gt;  }&lt;br /&gt;$query  = "CREATE DATABASE mydb";&lt;br /&gt;$result = mysql_query($query,$con);&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;Create a Table&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;CREATE TABLE statement is used to create a database table in MySQL database.&lt;!--p&lt;br--&gt;&lt;br /&gt;&lt;/p&gt;$con = mysql_connect("localhost:3306","adam","123456");&lt;br /&gt;if (!$con)&lt;br /&gt;  {&lt;br /&gt;  die('Could not connect: ' . mysql_error());&lt;br /&gt;&lt;p&gt;  }&lt;/p&gt;mysql_select_db("mydb", $con);&lt;br /&gt;mysql_query("CREATE TABLE emp_info(&lt;br /&gt;emp_id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id),Emp_name VARCHAR(30),&lt;br /&gt;Emp_age INT)")&lt;br /&gt; or die(mysql_error()); &lt;br /&gt;echo "Table Created";&lt;br /&gt;&lt;p&gt;?&amp;gt;&lt;/p&gt;             &lt;p align="center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60"&gt;&lt;param name="movie" value="http://www.studiesinn.com/banners/studiesinn.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;embed src="http://www.studiesinn.com/banners/studiesinn.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;                       &lt;script type="text/javascript"&gt;var addthis_pub = "qasimbilal";&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="" border="0" height="16" width="125" /&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-5298522733296079856?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/5298522733296079856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/5298522733296079856'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/connecting-to-mysql-database.html' title='Connecting to a MySQL Database'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-1330403660499174240</id><published>2009-03-02T09:14:00.000-08:00</published><updated>2010-12-20T02:37:38.925-08:00</updated><title type='text'>MySQL Data Types</title><content type='html'>&lt;strong&gt;Numeric Data Types:&lt;/strong&gt;&lt;br /&gt;&lt;table summary="" border="1" cellpadding="0" cellspacing="0" width="457"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign="top" width="104"&gt;TINYINT( )&lt;/td&gt;&lt;td valign="top" width="393"&gt;-128 to 127 normal 0 to 255 UNSIGNED.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;SMALLINT( )&lt;/td&gt;&lt;td valign="top"&gt;-32768 to 32767 normal 0 to 65535 UNSIGNED.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;MEDIUMINT( )&lt;/td&gt;&lt;td valign="top"&gt;-8388608 to 8388607 normal 0 to 16777215 UNSIGNED.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;INT( )&lt;/td&gt;&lt;td valign="top"&gt;-2147483648 to 2147483647 normal 0 to 4294967295 UNSIGNED.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;BIGINT( )&lt;/td&gt;&lt;td valign="top"&gt;-9223372036854775808 to 9223372036854775807 normal 0 to 18446744073709551615 UNSIGNED.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;FLOAT&lt;/td&gt;&lt;td valign="top"&gt;A small number with a floating decimal point.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;DOUBLE( , )&lt;/td&gt;&lt;td valign="top"&gt;A large number with a floating decimal point.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;DECIMAL( , )&lt;/td&gt;&lt;td valign="top"&gt;A DOUBLE stored as a string, allowing for a fixed decimal point.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;strong&gt;TEXT TYPES&lt;/strong&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;table summary="" border="1" cellpadding="0" cellspacing="0" width="456"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td valign="top" width="105"&gt;CHAR( )&lt;/td&gt;&lt;td valign="top" width="345"&gt;Fixed section from 0 to 255 characters long.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;VARCHAR( )&lt;/td&gt;&lt;td valign="top"&gt;Variable section from 0 to 255 characters long.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;TINYTEXT&lt;/td&gt;&lt;td valign="top"&gt;String with a maximum length of 255 characters.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;TEXT&lt;/td&gt;&lt;td valign="top"&gt;String with a maximum length of 65535 characters.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;BLOB&lt;/td&gt;&lt;td valign="top"&gt;String with a maximum length of 65535 characters.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;MEDIUMTEXT&lt;br /&gt;&lt;/td&gt;&lt;td valign="top"&gt;String with a maximum length of 16777215 characters.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;MEDIUMBLOB&lt;/td&gt;&lt;td valign="top"&gt;String with a maximum length of 16777215 characters.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;LONGTEXT&lt;/td&gt;&lt;td valign="top"&gt;String with a maximum length of 294967295 characters.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;LONGBLOB&lt;br /&gt;&lt;/td&gt;&lt;td valign="top"&gt;String with a maximum length of 4294967295 characters.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Date Data Types:&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;table summary="" border="1" cellpadding="0" cellspacing="0" width="383"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td valign="top" width="89"&gt;DATE&lt;/td&gt;&lt;td valign="top" width="188"&gt;YYYY-MM-DD.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;DATETIME&lt;/td&gt;&lt;td valign="top"&gt;YYYY-MM-DD H:MM:SS.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;TIMESTAMP&lt;/td&gt;&lt;td valign="top"&gt;YYYYMMDDHHMMSS.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;TIME&lt;/td&gt;&lt;td valign="top"&gt;HH:MM:SS.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;strong&gt;MISC Types&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;table summary="" border="1" cellpadding="0" cellspacing="0" width="385"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign="top" width="69"&gt;ENUM ( )&lt;/td&gt;&lt;td valign="top" width="310"&gt;ENUMERATION means that each column may have one of specified possible values.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top"&gt;SET&lt;/td&gt;&lt;td valign="top"&gt;SET is similar to ENUM. However, SET can have up to 64 list items and it can store more than one choice&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;             &lt;p align="center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60"&gt;&lt;param name="movie" value="http://www.studiesinn.com/banners/studiesinn.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;embed src="http://www.studiesinn.com/banners/studiesinn.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;                       &lt;script type="text/javascript"&gt;var addthis_pub = "qasimbilal";&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="" border="0" height="16" width="125" /&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-1330403660499174240?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/1330403660499174240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/1330403660499174240'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/mysql-data-types.html' title='MySQL Data Types'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-1751117063457073915</id><published>2009-03-01T10:09:00.001-08:00</published><updated>2010-12-20T02:37:54.317-08:00</updated><title type='text'>Inserting Data Into a Table</title><content type='html'>The INSERT INTO SQL statement impregnates our table with data. Here is a general form of INSERT.&lt;/p&gt;&lt;br /&gt;INSERT INTO table_name (column1, column2....) VALUES (value1, value2,....)&lt;br /&gt;&lt;p&gt;&amp;lt;?php&lt;br /&gt;$con = mysql_connect("localhost:3306","adam","123456");&lt;br /&gt;if (!$con)&lt;br /&gt;{&lt;br /&gt;die('Could not connect: ' . mysql_error());&lt;br /&gt;}&lt;/p&gt;mysql_select_db("mydb", $con);&lt;br /&gt;mysql_query("INSERT INTO empinfo (FirstName, LastName, Age)&lt;br /&gt;VALUES ('Adam', 'John', '22')");&lt;br /&gt;mysql_close($con);&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br&gt; &lt;p align="center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60"&gt;&lt;param name="movie" value="http://www.studiesinn.com/banners/studiesinn.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;embed src="http://www.studiesinn.com/banners/studiesinn.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;var addthis_pub = "qasimbilal";&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="" border="0" height="16" width="125" /&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-1751117063457073915?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/1751117063457073915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/1751117063457073915'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/inserting-data-into-table.html' title='Inserting Data Into a Table'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-1504926074352927181</id><published>2009-03-01T10:01:00.001-08:00</published><updated>2010-12-20T02:38:09.554-08:00</updated><title type='text'>Select Statement</title><content type='html'>The select query is used to retrieve records from a database. &lt;/p&gt;&lt;table summary="" border="1" cellpadding="0" cellspacing="0" width="397"&gt;&lt;tbody&gt;  &lt;tr&gt;    &lt;td valign="top" width="96"&gt;SELECT&lt;/td&gt;    &lt;td valign="top" width="295"&gt;Retrieves fields from one or more tables.&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;    &lt;td valign="top"&gt;FROM&lt;/td&gt; &lt;td valign="top"&gt;Tables containing the fields.&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;   &lt;td valign="top"&gt;WHERE&lt;/td&gt;  &lt;td valign="top"&gt;Criteria to restrict the records returned.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;  &lt;td valign="top"&gt;GROUP BY&lt;/td&gt;  &lt;td valign="top"&gt;Determines how the records should be grouped.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;  &lt;td valign="top"&gt;HAVING&lt;/td&gt; &lt;td valign="top"&gt;Used with GROUP BY to specify the criteria for the grouped records.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top"&gt;ORDER BY&lt;/td&gt;&lt;td valign="top"&gt;Criteria for ordering the records.&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt; &lt;td valign="top"&gt;LIMIT&lt;/td&gt;&lt;td valign="top"&gt;Limit the number of records returned.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;strong&gt;Syntax:&lt;br /&gt;&lt;/strong&gt;SELECT column_name(s)&lt;br /&gt;FROM table_name&lt;br /&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br /&gt;&lt;p&gt; &lt;/p&gt;&amp;lt;?php&lt;br /&gt;$con = mysql_connect("localhost:3306","adam","123456");&lt;br /&gt;if (!$con)&lt;br /&gt;{&lt;br /&gt;die('Could not connect: ' . mysql_error());&lt;br /&gt;}&lt;br /&gt;mysql_select_db("mydb", $con);&lt;br /&gt;$result = mysql_query("SELECT * FROM empinfo");&lt;br /&gt;while($row = mysql_fetch_array($result))&lt;br /&gt;{&lt;br /&gt;echo $row['FirstName'] . " " . $row['LastName'] . “ “ $row[‘Age’];&lt;br /&gt;echo "&amp;lt;br /&amp;gt;";&lt;br /&gt;}&lt;br /&gt;mysql_close($con);&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;p&gt;Returned  data from mysql_query() function will be stored in the result variable.  msql_fetch_array() function is used to return the first row from the  recordset as an array. The while loop loops through all the records in  the recordset and retrieve all the records from the recordset.&lt;/p&gt;&lt;br /&gt;Following function can be used in the select statement.&lt;br /&gt;&lt;table summary="" border="1" cellpadding="0" cellspacing="0" width="382"&gt; &lt;tbody&gt;&lt;tr&gt;    &lt;td valign="top" width="65"&gt;&lt;strong&gt;Function&lt;/strong&gt;&lt;/td&gt; &lt;td valign="top" width="317"&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;AVG()&lt;/td&gt; &lt;td valign="top"&gt;Returns the average value in a group of records. &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;  &lt;td valign="top"&gt;COUNT()&lt;/td&gt;  &lt;td valign="top"&gt;Returns the number of records in a group of records&lt;/td&gt;   &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;MAX()&lt;/td&gt;&lt;td valign="top"&gt;Returns the largest value in a group of records.&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;MIN()&lt;/td&gt;&lt;td valign="top"&gt;Returns the lowest value in a group of records &lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td valign="top"&gt;SUM()&lt;/td&gt;&lt;td valign="top"&gt;Returns the sum of a field. &lt;/td&gt; &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;strong&gt;Display the Result in an HTML Table&lt;br /&gt;&lt;/strong&gt;&lt;p&gt;&amp;lt;?php&lt;br /&gt;$con = mysql_connect("localhost:3306","adam","123456");&lt;br /&gt;if (!$con)&lt;br /&gt;{&lt;br /&gt;die('Could not connect: ' . mysql_error());&lt;br /&gt;&lt;/p&gt;}&lt;br /&gt;mysql_select_db("mydb", $con);&lt;br /&gt;&lt;p&gt;result = mysql_query("SELECT * FROM empinfo");&lt;br /&gt;&lt;br /&gt;echo "&amp;lt;table border='1' align=’center’&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;Firstname&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;Lastname&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;/p&gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;Age&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;";&lt;br /&gt;while($row = mysql_fetch_array($result))&lt;br /&gt;{&lt;br /&gt;echo "&amp;lt;tr&amp;gt;";&lt;br /&gt;echo "&amp;lt;td&amp;gt;" . $row['FirstName'] . "&amp;lt;/td&amp;gt;";&lt;br /&gt;&lt;p&gt;  echo "&amp;lt;td&amp;gt;" . $row['LastName'] . "&amp;lt;/td&amp;gt;";&lt;/p&gt;echo "&amp;lt;td&amp;gt;" . $row['Age'] . "&amp;lt;/td&amp;gt;";&lt;br /&gt;&lt;br /&gt;echo "&amp;lt;/tr&amp;gt;";&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;echo "&amp;lt;/table&amp;gt;";&lt;br /&gt;mysql_close($con);&lt;br /&gt;&lt;p&gt;?&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;p align="center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60"&gt;&lt;param name="movie" value="http://www.studiesinn.com/banners/studiesinn.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;embed src="http://www.studiesinn.com/banners/studiesinn.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;var addthis_pub = "qasimbilal";&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="" border="0" height="16" width="125" /&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-1504926074352927181?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/1504926074352927181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/1504926074352927181'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/select-statement.html' title='Select Statement'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-3096218902886447595</id><published>2009-03-01T09:55:00.000-08:00</published><updated>2010-12-20T02:39:18.169-08:00</updated><title type='text'>Where Clause</title><content type='html'>In Select Query we use WHERE clause to select only data that matches a specified criteria. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;&lt;br /&gt;SELECT column(s) FROM tablename WHERE column operator value&lt;br /&gt;&lt;strong&gt;Example:&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;Table Name(&lt;/strong&gt;empinfo&lt;strong&gt;)&lt;/strong&gt;&lt;/p&gt;&lt;table summary="" border="1" cellpadding="0" width="431"&gt; &lt;tbody&gt;  &lt;tr&gt;&lt;td width="71"&gt;&lt;strong&gt;FirstName&lt;/strong&gt;&lt;/td&gt;&lt;td width="70"&gt;&lt;strong&gt;LastName      &lt;/strong&gt;&lt;/td&gt;&lt;td width="194"&gt;&lt;strong&gt;Email&lt;/strong&gt;&lt;/td&gt; &lt;td width="76"&gt;&lt;strong&gt;DOB &lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Steve&lt;/td&gt;&lt;td&gt;Martin&lt;/td&gt;&lt;td&gt;smart.steve@studiesinn.com&lt;/td&gt;&lt;td&gt;08-04-1988&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;David&lt;/td&gt;   &lt;td&gt;Fernandas&lt;/td&gt;&lt;td&gt;davidfernandas@studiesinn.com&lt;/td&gt; &lt;td&gt;04-16-1977&lt;/td&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;td&gt;Ajay&lt;/td&gt;&lt;td&gt;Rathor&lt;/td&gt;&lt;td&gt;ajayrathor@studiesinn.com&lt;/td&gt;&lt;td&gt;08-24-1986&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;$con = mysql_connect("localhost:3306","adam","123456");&lt;br /&gt;if (!$con)&lt;br /&gt;  {&lt;br /&gt;  die('Could not connect: ' . mysql_error());&lt;br /&gt;&lt;p&gt;  }&lt;/p&gt;mysql_select_db("mydb", $con);&lt;br /&gt;$result = mysql_query("SELECT * FROM empinfo where FirstName=’David’");&lt;br /&gt;while($row = mysql_fetch_array($result))&lt;br /&gt;  {&lt;br /&gt;  echo $row['FirstName'] . " " . $row['LastName'] . “ “ $row[‘DOB’];&lt;br /&gt;  echo "&amp;lt;br /&amp;gt;";&lt;br /&gt;  }&lt;br /&gt;mysql_close($con);&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;p&gt;Output will be.&lt;/p&gt;David Fernandas 04-16-1977&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Operator that can be used in where clause are as under&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;= Equal&lt;br /&gt;&lt;br /&gt;!= Not equal&lt;br /&gt;&lt;br /&gt;&amp;gt; Greater than&lt;br /&gt;&lt;br /&gt;&amp;lt; Less than&lt;br /&gt;&lt;br /&gt;&amp;gt;= Greater than or equal&lt;br /&gt;&lt;br /&gt;&amp;lt;= Less than or equal&lt;br /&gt;&lt;br /&gt;BETWEEN Between an inclusive range&lt;br /&gt;&lt;br /&gt;LIKE Search for a pattern&lt;br /&gt;&lt;p align="center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60"&gt;&lt;param name="movie" value="http://www.studiesinn.com/banners/studiesinn.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;embed src="http://www.studiesinn.com/banners/studiesinn.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;                                   &lt;script type="text/javascript"&gt;var addthis_pub = "qasimbilal";&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="" border="0" height="16" width="125" /&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-3096218902886447595?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/3096218902886447595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/3096218902886447595'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/where-clause.html' title='Where Clause'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-5690656731256612360</id><published>2009-03-01T09:53:00.003-08:00</published><updated>2010-12-20T02:39:29.091-08:00</updated><title type='text'>Order By</title><content type='html'>We use Order By Keyword to sort the records in a recordset. The general syntax is as under. &lt;/p&gt;&lt;br /&gt;&lt;strong&gt;Syntax:&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;SELECT columnname(s) FROM tablename ORDER BY columnname SortOrder&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Example:&lt;br /&gt;Table Name(&lt;/strong&gt;empinfo&lt;strong&gt;)&lt;/strong&gt;&lt;br /&gt;&lt;/p&gt;&lt;table summary="" border="1" cellpadding="0" width="431"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td width="71"&gt;&lt;strong&gt;FirstName&lt;/strong&gt;&lt;/td&gt; &lt;td width="70"&gt;&lt;strong&gt;LastName&lt;/strong&gt;&lt;/td&gt;     &lt;td width="194"&gt;&lt;strong&gt;Email &lt;/strong&gt;&lt;/td&gt;  &lt;td width="76"&gt;&lt;strong&gt;DOB&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td&gt;Steve&lt;/td&gt;&lt;td&gt;Martin&lt;/td&gt;&lt;td&gt;smart.steve@studiesinn.com&lt;/td&gt;&lt;td&gt;08-04-1988&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;David&lt;/td&gt;&lt;td&gt;Fernandas&lt;/td&gt;&lt;td&gt;davidfernandas@studiesinn.com&lt;/td&gt;&lt;td&gt;04-16-1977&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Ajay&lt;/td&gt;&lt;td&gt;Rathor&lt;/td&gt;&lt;td&gt;ajayrathor@studiesinn.com&lt;/td&gt;&lt;td&gt;08-24-1986&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;?php&lt;br /&gt;&lt;p&gt;$con = mysql_connect("localhost:3306","adam","123456");&lt;br /&gt;if (!$con)&lt;br /&gt;  {&lt;br /&gt;  die('Could not connect: ' . mysql_error());&lt;br /&gt;&lt;/p&gt;&lt;p&gt;  }&lt;/p&gt;mysql_select_db("mydb", $con);&lt;br /&gt;$result = mysql_query("SELECT * FROM empinfo order by FirstName asc");&lt;br /&gt;while($row = mysql_fetch_array($result))&lt;br /&gt;  {&lt;br /&gt;  echo $row['FirstName'] . " " . $row['LastName'] . “ “ $row[‘DOB];&lt;br /&gt;  echo "&amp;lt;br /&amp;gt;";&lt;br /&gt;  }&lt;br /&gt;mysql_close($con);&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;p&gt;The Output will be&lt;br /&gt;Ajay Rathor 08-24-1986&lt;br /&gt;David Fernandas 04-16-1977&lt;br /&gt;Steve Martin 08-04-1988&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;Note:&lt;br /&gt;&lt;/strong&gt;SortOrder is optional if you does not use it the records will be sorted in ascending order (1 to 10 or a to z).  Use  DESC as SortOrder to sort records in descending order. RAND() is used  for random sort. SQL statements are not case sensitive. You can use  both capital letters and small letter.&lt;br /&gt;&lt;/p&gt;               &lt;p align="center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60"&gt;&lt;param name="movie" value="http://www.studiesinn.com/banners/studiesinn.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;embed src="http://www.studiesinn.com/banners/studiesinn.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;                     &lt;script type="text/javascript"&gt;var addthis_pub = "qasimbilal";&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="" border="0" height="16" width="125" /&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-5690656731256612360?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/5690656731256612360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/5690656731256612360'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/order-by.html' title='Order By'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-7549962584702162619</id><published>2009-03-01T09:53:00.001-08:00</published><updated>2010-12-20T02:39:46.103-08:00</updated><title type='text'>Update and Delete Statement</title><content type='html'>Update statement is used to modify the data in a database table. The general syntax is as under. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;&lt;br /&gt;UPDATE tablename SET columnname = newvalue WHERE columnname = value&lt;br /&gt;&lt;strong&gt;Example:&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;Table Name(&lt;/strong&gt;empinfo&lt;strong&gt;)&lt;/strong&gt;&lt;/p&gt;&lt;table summary="" border="1" cellpadding="0" width="431"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td width="71"&gt;&lt;strong&gt;FirstName&lt;/strong&gt;&lt;/td&gt;&lt;td width="70"&gt;&lt;strong&gt;LastName&lt;/strong&gt;&lt;/td&gt;      &lt;td width="194"&gt;&lt;strong&gt;Email&lt;/strong&gt;&lt;/td&gt;&lt;td width="76"&gt;&lt;strong&gt;DOB&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Steve&lt;br /&gt;&lt;/td&gt;&lt;td&gt;Martin&lt;/td&gt;&lt;td&gt;smart.steve@studiesinn.com&lt;/td&gt;&lt;td&gt;08-04-1988&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;David&lt;/td&gt;&lt;td&gt;Fernandas&lt;/td&gt;&lt;td&gt;davidfernandas@studiesinn.com&lt;/td&gt;&lt;td&gt;04-16-1977&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Ajay&lt;/td&gt;&lt;td&gt;Rathor&lt;/td&gt;&lt;td&gt;ajayrathor@studiesinn.com&lt;/td&gt;&lt;td&gt;08-24-1986&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;$con = mysql_connect("localhost:3306","adam","123456");&lt;br /&gt;if (!$con)&lt;br /&gt;{&lt;br /&gt;die('Could not connect: ' . mysql_error());&lt;br /&gt;&lt;p&gt;  }&lt;/p&gt;mysql_select_db("mydb", $con);&lt;br /&gt;$result = mysql_query("Update empinfo Set DOB=’07-05-1988’ where FirstName=’Steve’");&lt;br /&gt;mysql_close($con);&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;table summary="" border="1" cellpadding="0" width="431"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td width="71"&gt;&lt;strong&gt;FirstName&lt;/strong&gt;&lt;/td&gt;&lt;td width="70"&gt;&lt;strong&gt;LastName&lt;/strong&gt;&lt;/td&gt;&lt;td width="194"&gt;&lt;strong&gt;Email&lt;/strong&gt;&lt;/td&gt;&lt;td width="76"&gt;&lt;strong&gt;DOB&lt;/strong&gt;&lt;/td&gt;   &lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Steve&lt;/td&gt;&lt;td&gt;Martin&lt;/td&gt;&lt;td&gt;smart.steve@studiesinn.com&lt;/td&gt;&lt;td&gt;07-05-1988&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;David&lt;/td&gt;&lt;td&gt;Fernandas&lt;/td&gt;&lt;td&gt;davidfernandas@studiesinn.com&lt;/td&gt;&lt;td&gt;04-16-1977&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Ajay&lt;/td&gt;&lt;td&gt;Rathor&lt;/td&gt;&lt;td&gt;ajayrathor@studiesinn.com&lt;/td&gt;&lt;td&gt;08-24-1986&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt; &lt;/p&gt;&lt;script type="text/javascript"&gt;var addthis_pub = "qasimbilal";&lt;/script&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Delete Statement&lt;/span&gt;&lt;br /&gt;DELETE FROM statement is used to delete rows from a database table. The general syntax is as under.&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;&lt;br /&gt;DELETE FROM tablename WHERE columnname = value&lt;/p&gt;&lt;span style="font-weight: bold;"&gt;Example:&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;Table Name(&lt;/strong&gt;empinfo&lt;strong&gt;)&lt;/strong&gt;&lt;table border="1" cellpadding="0" cellspacing="0" width="421"&gt;    &lt;tbody&gt;&lt;tr&gt;    &lt;td width="71"&gt;&lt;strong&gt;FirstName&lt;/strong&gt;&lt;/td&gt;    &lt;td width="70"&gt;&lt;strong&gt;LastName&lt;/strong&gt;&lt;/td&gt;    &lt;td width="194"&gt;&lt;strong&gt;Email&lt;/strong&gt;&lt;/td&gt;&lt;td width="76"&gt;&lt;strong&gt;DOB    &lt;/strong&gt;&lt;/td&gt; &lt;/tr&gt;  &lt;tr&gt;    &lt;td&gt;Steve&lt;/td&gt;    &lt;td&gt;Martin&lt;/td&gt;  &lt;td&gt;smart.steve@studiesinn.com&lt;/td&gt;    &lt;td&gt;08-04-1988&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;    &lt;td&gt;David&lt;/td&gt;    &lt;td&gt;Fernandas&lt;/td&gt;    &lt;td&gt;davidfernandas@studiesinn.com&lt;/td&gt;    &lt;td&gt;04-16-1977&lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;    &lt;td&gt;Ajay&lt;/td&gt;    &lt;td&gt;Rathor&lt;/td&gt;  &lt;td&gt;ajayrathor@studiesinn.com&lt;/td&gt;    &lt;td&gt;08-24-1986&lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;$con = mysql_connect("localhost:3306","adam","123456");&lt;br /&gt;if (!$con)&lt;br /&gt;{&lt;br /&gt;die('Could not connect: ' . mysql_error());&lt;br /&gt;&lt;p&gt;  }&lt;/p&gt;mysql_select_db("mydb", $con);&lt;br /&gt;$result = mysql_query("Delete From empinfo  where FirstName=’Steve’");&lt;br /&gt;mysql_close($con);&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;table border="1" cellpadding="0" width="420"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td width="71"&gt;&lt;strong&gt;FirstName&lt;/strong&gt;&lt;/td&gt;&lt;td width="70"&gt;&lt;strong&gt;LastName&lt;/strong&gt;&lt;/td&gt;      &lt;td width="194"&gt;&lt;strong&gt;Email&lt;/strong&gt;&lt;/td&gt;&lt;td width="76"&gt;&lt;strong&gt;DOB&lt;/strong&gt;&lt;/td&gt;  &lt;/tr&gt;&lt;tr&gt;&lt;td&gt;David&lt;/td&gt;&lt;td&gt;Fernandas&lt;/td&gt;&lt;td&gt;davidfernandas@studiesinn.com&lt;/td&gt;  &lt;td&gt;04-16-1977&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Ajay&lt;/td&gt;&lt;td&gt;Rathor&lt;/td&gt;&lt;td&gt;ajayrathor@studiesinn.com&lt;/td&gt;&lt;td&gt;08-24-1986&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;p align="center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60"&gt;&lt;param name="movie" value="http://www.studiesinn.com/banners/studiesinn.swf" /&gt;&lt;param name="quality" value="high" /&gt;&lt;embed src="http://www.studiesinn.com/banners/studiesinn.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;var addthis_pub = "qasimbilal";&lt;/script&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-share-en.gif" alt="" border="0" height="16" width="125" /&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-7549962584702162619?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/7549962584702162619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/7549962584702162619'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/update-statement_01.html' title='Update and Delete Statement'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-1619725840347992526.post-8730715490162737806</id><published>2009-03-01T09:52:00.001-08:00</published><updated>2010-12-20T02:40:01.740-08:00</updated><title type='text'>Links</title><content type='html'>&lt;a href="http://www.mytraininghub.com/"&gt;My Training Hub&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.securityclimate.org/"&gt;Security Climate Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.doharugbyfc.com/"&gt;Doharugbyfc&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.cheetosokumaodasi.com"&gt;ADD URL :: Submit URL&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.rootfl.org/"&gt;Root Fl Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ostwestfreizeit.com/"&gt;Free Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.zoock.net/"&gt;ZoocK Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://smalandoland.com"&gt;Quality Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.sudnet.org/"&gt;SudNET Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ribcast.com/"&gt;RibCast Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.mixingitup.info/"&gt;Quality Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.femeba.net"&gt;Femeba Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.etninvesting.com" id="R0"&gt;ETN Free Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ablazedirectory.com/"&gt;Ablaze Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.soundsolutionsam1.com/"&gt;SoundSolutionSam1&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.mydirectorylive.com/"&gt;My Directory Live&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ncldf.com"&gt;Net Collector&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.jsum.org/"&gt;jSum Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.linkaddurl.com"&gt;LINK ADD URL Seo Friendly Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.winapple.info/"&gt;Winapple Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.huahua.info/"&gt;Huahua General Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.kostel.org/"&gt;Web directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.pegasusdirectory.com"&gt;Free web directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.esi-q.info"&gt;eSiq Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.katerart.com/"&gt;Welcome to Katerart.com, a website Directory.&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.directorybin.com"&gt;Directory Bin&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.all-linkdirectory.com" &gt; All Links Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.miriblack.com/"&gt;MiriBlack Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.submiturl.in/directory"&gt;Submit URL Directory!&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.seoweb2.info/"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.eportlandhomes.info"&gt;Portland ORE Homes&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.zydamax.com"&gt;Zydamax Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.banyapa.com"&gt;Banyapa Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.2006cigr.org"&gt;2006cigr-Directory Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://directory.seoexecutive.com/" id="R46B573"&gt;SEO Executive&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.freeprwebdirectory.com"&gt;PR5 Directories&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.chinafixer.net/"&gt;ChinaFixer - Free Internet Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.xfoksite.net"&gt;Free Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.3mss.com/"&gt;3MSS Directory Submission&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.traveltourismdirectory.info"&gt;Directory Travel&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.wwwi.co.uk"&gt;Business Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.pittsburghartreview.org"&gt;Pittsburgh Art Review Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.anaximanderdirectory.com/"&gt;Anaximander Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.clattorney.com/"&gt;Free Web Directory&lt;/a&gt;&lt;br /&gt; &lt;a href='http://www.littlewebdirectory.com/' &gt;Free Web Directory - Add Your Link&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.desarrolo.com"&gt;Desarrolo Link Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.clattorney.com/"&gt;Free Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.desarrolo.com"&gt;Desarrolo Link Directory&lt;/a&gt;&lt;br /&gt; &lt;a href='http://www.littlewebdirectory.com/' &gt;Free Web Directory - Add Your Link&lt;/a&gt;&lt;br&gt;The Little Web Directory&lt;br&gt;&lt;br /&gt;&lt;a href="http://www.kk-club.com/"&gt;KK-CLUB&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.soft4each.com/"&gt;Soft4Each Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.netwerker.com/"&gt;Free web directory - Netwerker&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ascia2008.com"&gt;Quality Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ynjjdg.com/"&gt;Ynjjdg - Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.nkssnet.net/"&gt;Net Knowledge&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.clocktowerstudio.com/"&gt;Clock Tower Studio - General Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.devoteclub.com/"&gt;DevoteClub - Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.eatdrinkfeelgood.org/"&gt;Web Directory - Top Sites&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.faba.us"&gt;Faba Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.cagtermal.com/"&gt;Cagtermal&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.skoobe.biz" &gt;Skoobe Link Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.rcreducation.com/"&gt;RcrEducation - Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.bondbanking.com" id="R0"&gt;Free Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.webdee.org/"&gt;Webdee.org FREE Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.arakne-links.com"&gt;Arakne-Links Directory&lt;/a&gt;&lt;br /&gt;&lt; a href='http://www.directorystorm.com/' &gt; Directory Storm&lt; /a &gt;&lt;br /&gt;&lt;a href="http://www.o9i.net/"&gt;Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.linkroo.com/"&gt;Linkroo - A better place for Backlinks | SEO Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.hitalyzer.com/"&gt;Submit site - web site promotion - Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.musicmaza.com"&gt;Indian Songs, Pakistani Songs, Bollywood Songs&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.urozope.org/"&gt;Urozope.org Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.magdalyns.com/"&gt;MagDalyns Online&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.1adir.com"&gt;1 A  Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.bbbfit.com/"&gt;Bbbfit- Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href='http://www.sportsmans-depot.com'&gt;Sportsman's Depot is the leading provider of Hunting, Fishing, Camping and outdoor accessories online! We offer an array of sporting supplies to fit your every need, with the best prices on the web. You can find every top brand at the lowest prices at Sportsman's Depot&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.west2002.org"&gt;West Web directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.aaf14.org"&gt;Always and Forever 14&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.bryancampen.com/"&gt;Bryancampen - Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.sbclansite.com/"&gt;Free Image Hosting A1 Family Friendly Directory with Deeplinks&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.seofriendlydirectory4u.com/"&gt;Free SEO Friendly Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.websitejoint.com"&gt;Search Engine Friendly Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.cfkap.com/"&gt;Cfkap Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://niresource.com/"&gt;NI Resource Directory&lt;/a&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://www.phillyfirstonthefourth.com" target="_blank" title="SEO Web Directory"&gt;Search engine friendly directory&lt;/a&gt;&lt;/b&gt;&lt;br&gt;&lt;br /&gt;&lt;a href="http://www.websitejoint.com"&gt;Search Engine Friendly Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.hrce.com/"&gt;HRCE Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.e-mediate.org/" id="R0"&gt;E-Mediate.org&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.hrce.com/"&gt;HRCE Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.yasamayadeger.com/"&gt;YasamayaDeger - Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.wahweb.com/"&gt;Wah Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.safadairy.com/"&gt;Safadairy - Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.urldirectory.org/"&gt;URL Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.koaladir.com/"&gt;Quality Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.yelk.net/" target="_blank"&gt;Yelk.net - Search for sites by their descriptions. Try it!&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.businesssitesonthenet.co.uk"&gt;Business Sites on the Net&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.digidagi.com/"&gt;DigiDagi Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.allsitessorted.com/"&gt;Web Directory - All Sites Sorted&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.prvoices.com/"&gt;PR General Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.apleintubes.com"&gt;ApleinTubes Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.munoa.org/"&gt;Munoa- Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.projectempowerment.com/"&gt;Project Empowerment Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.jhucr.org"&gt;JHUCR Free Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.sentrega.com"&gt;Sentrega Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.piseries.com" &gt;Piseries Link Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.memewarrior.com/"&gt;Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.mozizona.com/"&gt;Mozizona - Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.golftournamentregistry.com/"&gt;Golf Tournament Registry&lt;/a&gt;&lt;br /&gt;&lt;a href="http://ft8.org"&gt;Ft8 Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.samaprzyjemnosc.pl" &gt;Deep Links Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.wishdc.org/"&gt;WishDC.org Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.vietnam-hub.com/"&gt;Vietnam-Hub&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.pzsa.com"&gt;PZSA Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.cfstudio.net/"&gt;Cfstudio - Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.chaqra.com/"&gt;Chaqra Directory&lt;/a&gt;&lt;br /&gt;&lt; a href='http://www.okaysites.com/' &gt; Okay Sites&lt; /a &gt;&lt;br /&gt;&lt;a href="http://www.wybnb.com/"&gt;wybnb.com&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.webdiro.com"&gt;WebDiro Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.lutonengineering.com/"&gt;Free Web Directory - Deep Links OK!&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.zngp.com"&gt;ZN Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.gmdm.info/"&gt;Gmdm Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.az-links.info"&gt;AZ Links Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.holidaydig.com/"&gt;HolidayDig Free Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.gainweb.org/"&gt;Gain Web&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.technoworld.org/"&gt;Technoworld - Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.increasedirectory.com"&gt;Increase Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.msgat.com/" id="R0"&gt;Msgat - Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.wishdc.org/"&gt;WishDC.org Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.vipdig.com/"&gt;VipDig Free Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.tripledirectory.com"&gt;Human Edited Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.eozbird.com"&gt;Quality Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.submit.biz" &gt;Submit url&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.tuckinfo.com/" id="R0"&gt;Tuckinfo Directory-Submit Link&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.1adir.com"&gt;1 A  Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.siztech.com"&gt;Siz Tech Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.projectempowerment.com/"&gt;Project Empowerment Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.bbbfit.com/"&gt;Bbbfit- Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.memewarrior.com/"&gt;Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.vitrolaz.com"&gt;Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.leetech.net"&gt;Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.yourdomain.com/"&gt;Site Name&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.web-master-directory.com/"&gt;Web Master Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.maverickmoon.com/"&gt;MaverickMoon - Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.counterdeal.com/"&gt;COUNTERDEAL.COM&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.thalesdirectory.com"&gt;Thales Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.zipidor.com"&gt;12 years old quailty web directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.pop-net.org" id="RCD231A"&gt;Popular Directory Pop-Net.org&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.thaica.org"&gt;Thai Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.temnoticia.com/"&gt;Temnoticia&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.jointmc.com/"&gt;Jointmc - Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.bymattking.com/"&gt;ByMattKing - Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.gg-directory.info/"&gt;GG Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.jjhou.com/"&gt;Jjhou general directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.neks.info/"&gt;Neks - Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.aidasart.com"&gt;Quality Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.directory.ldmstudio.com" title="web directory" target="_blank"&gt;Ldmstudio Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.aidasart.com"&gt;Quality Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.blogs-collection.com/" title="blogs directory" target="_blank"&gt;Blogs Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.directoryvault.com"&gt;DirectoryVault Free Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.aqard.com/"&gt;Aqard - Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.webhotlink.com"&gt;Human edited web directory Web Hot Link general online internet web directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.msgat.com/" id="R0"&gt;Msgat - Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.cmdg.biz/"&gt;CMDG&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.webhotlink.com"&gt;Human edited web directory Web Hot Link general online internet web directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.scablevel.com/"&gt;Scablevel - Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.directoryvault.com"&gt;DirectoryVault Free Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.pattiswagons.com/"&gt;Pattis Wagons Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.sostro.net/"&gt;Sostro - Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ddht.net/"&gt;Web Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.yourdomain.com/"&gt;Site Name&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.alldeny.com/"&gt;Alldeny - Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.lefolio.com/"&gt;Lefolio - Submit Your Site&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.mygreencorner.com/"&gt;My Green Corner&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.h-pf.com/"&gt;H-PF - Free Directories&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.freewebsitedirectory.com"&gt;Free Website Directory&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.directory-link.info" id="R625E0E"&gt;Directory Link&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.bnpt.net"&gt;Web Directory&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619725840347992526-8730715490162737806?l=lectures-php.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/8730715490162737806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619725840347992526/posts/default/8730715490162737806'/><link rel='alternate' type='text/html' href='http://lectures-php.blogspot.com/2009/03/delete-from-statement.html' title='Links'/><author><name>Malik</name><uri>http://www.blogger.com/profile/13602544266228369990</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>
