<?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-3891726027537827996</id><updated>2011-11-27T16:55:42.253-08:00</updated><title type='text'>booleandreams</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://booleandreams.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3891726027537827996/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://booleandreams.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>PHP Tutor</name><uri>http://www.blogger.com/profile/16269878958363853388</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>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3891726027537827996.post-3356276287507746307</id><published>2007-08-20T02:00:00.000-07:00</published><updated>2007-08-20T02:03:33.857-07:00</updated><title type='text'>PHP-MySQL Interview Question - 2</title><content type='html'>&lt;table class="mceVisualAid"   style=";font-family:Verdana;font-size:10pt;" border="0" cellpadding="3" cellspacing="0" width="525"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td class="mceVisualAid" bg="" style="color: rgb(255, 204, 102);" align="left" valign="top" width="34"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;b&gt;Q:81&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bg style="color:#ffcc66;"&gt;&lt;b&gt;What is ‘float’ property in CSS?&lt;br /&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;A:81&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" align="justify"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;The float property sets where an image or a text will appear in another element.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" bg="" style="color: rgb(255, 204, 102);" align="left" valign="top" width="34"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;b&gt;Q:82&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bg style="color:#ffcc66;"&gt;&lt;b&gt;What is descendant structure in CSS?&lt;br /&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;A:82&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" align="justify"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;Descendant selectors are used to select elements that are descendants of another element in the document tree.For example, you may wish to target a specific &lt;em&gt; element on the page, but not all &lt;em&gt; elements. A sample document could contain the following code:&lt;code&gt;   &lt;&lt;b&gt;body&lt;/b&gt;&gt;&lt;br /&gt;&lt;&lt;b&gt;h1&lt;/b&gt;&gt;Heading &lt;&lt;b&gt;em&lt;/b&gt;&gt;here&lt;!--&lt;b--&gt;em&gt; &lt;!--&lt;b--&gt;h1&gt;&lt;br /&gt;&lt;&lt;b&gt;p&lt;/b&gt;&gt;Lorem ipsum dolor &lt;&lt;b&gt;em&lt;/b&gt;&gt;sit&lt;!--&lt;b--&gt;em&gt; amet.&lt;!--&lt;b--&gt;p&gt;&lt;br /&gt;&lt;!--&lt;b--&gt;body&gt;  &lt;/code&gt;   The document tree diagram (with the &lt;em&gt; element to be targeted) would be:&lt;img src="http://css.maxdesign.com.au/selectutorial/images/tree_desc_select.gif" mce_src="http://css.maxdesign.com.au/selectutorial/images/tree_desc_select.gif" alt="Document tree showing descendant selectors" height="123" width="136" /&gt;If you use a type selector like the example below, you will select all &lt;em&gt; elements on the page:&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/span&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt; &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;   &lt;b&gt;em&lt;/b&gt; {color: blue; }  &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt; However, if you use a descendant selector, you can refine the &lt;em&gt; elements that you select. The rule below will only select &lt;em&gt; elements that are descendants of &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;p&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt; elements. If this rule is applied, the &lt;em&gt; element within the &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/p&gt;&lt;h1&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt; will not be colored blue.&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/h1&gt;&lt;/span&gt;&lt;/p&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt; &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;   &lt;b&gt;p em&lt;/b&gt; {color: blue; }  &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;   You can also jump levels in the document tree structure to select descendants. For example, the following code:&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt; &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;   &lt;&lt;b&gt;body&lt;/b&gt;&gt;&lt;br /&gt;&lt;&lt;b&gt;p&lt;/b&gt;&gt;Lorem ipsum dolor &lt;&lt;b&gt;em&lt;/b&gt;&gt;sit&lt;!--&lt;b--&gt;em&gt; amet.&lt;!--&lt;b--&gt;p&gt;&lt;br /&gt;&lt;&lt;b&gt;ul&lt;/b&gt;&gt;&lt;br /&gt;&lt;&lt;b&gt;li&lt;/b&gt;&gt;item 1&lt;!--&lt;b--&gt;li&gt;&lt;br /&gt;&lt;&lt;b&gt;li&lt;/b&gt;&gt;item 2&lt;!--&lt;b--&gt;li&gt;&lt;br /&gt;&lt;&lt;b&gt;li&lt;/b&gt;&gt;&lt;&lt;b&gt;em&lt;/b&gt;&gt;item 3&lt;!--&lt;b--&gt;em&gt;&lt;!--&lt;b--&gt;li&gt;&lt;br /&gt;&lt;!--&lt;b--&gt;ul&gt;&lt;br /&gt;&lt;!--&lt;b--&gt;body&gt;  &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;   The document tree (with a third-level &lt;em&gt; element highlighted) would be:&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt; &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;img src="http://css.maxdesign.com.au/selectutorial/images/tree_desc_select2.gif" mce_src="http://css.maxdesign.com.au/selectutorial/images/tree_desc_select2.gif" alt="Document tree showing descendant selectors" height="160" width="255" /&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt; &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;Using the following rule you can isolate any &lt;em&gt; element inside a &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;ul&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt; element, without having to describe the &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;li&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt; element. If this rule is applied, any &lt;em&gt; element within a &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;ul&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt; element will be colored blue. However, the &lt;em&gt; element within the &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;p&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt; will not be colored blue:&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/p&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt; &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;   &lt;b&gt;ul em&lt;/b&gt; {color: blue; }  &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;   Descendant selectors are well supported across standards-compliant browsers.&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" bg="" style="color: rgb(255, 204, 102);" align="left" valign="top" width="34"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;b&gt;Q:83&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bg style="color:#ffcc66;"&gt;&lt;b&gt;What is Child Descendant structure in CSS?&lt;br /&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;A:83&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" align="justify"&gt; &lt;h2&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;   Child selectors&lt;/span&gt;&lt;/h2&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;A child selector is used to select an element that is a direct child of another element (parent). Child selectors will not select all descendants, only direct children.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;For example, you may wish to target an &lt;em&gt; that is a direct child of a &lt;/em&gt;&lt;div&gt;&lt;em&gt;, but not other &lt;em&gt; elements that are descendants of the &lt;/em&gt;&lt;/em&gt;&lt;div&gt;&lt;em&gt;&lt;em&gt;. A sample document could contain the following code:&lt;/em&gt;&lt;/em&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/p&gt;&lt;em&gt;&lt;em&gt; &lt;/em&gt;&lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;em&gt;&lt;em&gt;   &lt;&lt;b&gt;body&lt;/b&gt;&gt;&lt;br /&gt;&lt;&lt;b&gt;h1&lt;/b&gt;&gt;Heading &lt;&lt;b&gt;em&lt;/b&gt;&gt;text&lt;!--&lt;b--&gt;em&gt;&lt;!--&lt;b--&gt;h1&gt;&lt;br /&gt;&lt;&lt;b&gt;div&lt;/b&gt;&gt;&lt;br /&gt;This is some &lt;&lt;b&gt;em&lt;/b&gt;&gt;text&lt;!--&lt;b--&gt;em&gt;&lt;br /&gt;&lt;&lt;b&gt;p&lt;/b&gt;&gt;This is a paragraph of &lt;&lt;b&gt;em&lt;/b&gt;&gt;text&lt;!--&lt;b--&gt;em&gt;&lt;!--&lt;b--&gt;p&gt;&lt;br /&gt;&lt;!--&lt;b--&gt;div&gt;&lt;br /&gt;&lt;!--&lt;b--&gt;body&gt;&lt;br /&gt;&lt;/em&gt;&lt;/em&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;em&gt;&lt;em&gt;   The document tree (highlighting the &lt;em&gt; that is a child of the &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;div&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;) would be:&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/div&gt;&lt;/span&gt;&lt;/p&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt; &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;img src="http://css.maxdesign.com.au/selectutorial/images/tree_child_select.gif" mce_src="http://css.maxdesign.com.au/selectutorial/images/tree_child_select.gif" alt="Document tree showing child selector" height="160" width="200" /&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt; &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;Using the following rule you can target any &lt;em&gt; element that is a child of the &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;div&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;. Other &lt;em&gt; elements that are descendants but not direct children of the &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;div&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt; will not be targeted.&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/p&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt; &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;   &lt;b&gt;div &gt; em&lt;/b&gt; { color: blue; }&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt; &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;OR&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt; &lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;em&gt;&lt;b&gt;div&gt;em&lt;/b&gt; { color: blue; }&lt;br /&gt;Child selectors are &lt;b&gt;not&lt;/b&gt; supported by Windows Internet Explorer 5, 5.5 and 6, but are supported by most other standards-compliant browsers.&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" bg="" style="color: rgb(255, 204, 102);" align="left" valign="top" width="34"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;b&gt;Q:84&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bg style="color:#ffcc66;"&gt;&lt;b&gt;&lt;span class="q"&gt;How to create a class in JavaScript?&lt;/span&gt;&lt;/b&gt;&lt;b&gt;       &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;A:84&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" align="justify"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;Classes can seem off-putting at first, but once you see the point of them, their use can be invaluable.We have already met objects. A computer object is a representation of a real object. For an estate agent the object may be a house, including information about the number of rooms and the price.An estate agent may have a lot of houses available. These houses all have different characteristics, and as objects they all go through the same processes. They are viewed, surveyed and bought, and so on.A full estate agent program would be difficult to demonstrate here, but we can introduce the use of classes.In this example, we have the house class. The house class produces house objects, all with object properties, such as number of rooms and price, and all having access to the same methods, such as sold and bought.&lt;/span&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;So a class can create objects with a group of properties and methods.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;JavaScript doesn't have a keyword specific to class, so we must go back to basics and develop classes in a different way. This isn't very difficult.&lt;/span&gt;&lt;/p&gt; &lt;h3&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;Class Properties&lt;/span&gt;&lt;/h3&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;Let us examine a very small &lt;a href="http://www.webdevelopersjournal.com/articles/jsintro3/estateagent.htm" mce_href="http://www.webdevelopersjournal.com/articles/jsintro3/estateagent.htm"&gt;estate agent program&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;br /&gt;&lt;br /&gt;&lt;title&gt;Estate Agent&lt;/title&gt;&lt;br /&gt;&lt;script&gt;&lt;br /&gt;function House(rooms,price,garage) {&lt;br /&gt;this.rooms=rooms;&lt;br /&gt;this.price=price;&lt;br /&gt;this.garage=garage;&lt;br /&gt;}&lt;br /&gt;house1=new House(4,100000,false);&lt;br /&gt;house2=new House(5,200000,true);&lt;br /&gt;with (house1) document.write('House 1 has '+rooms+' rooms, '+(garage?'a':'no')+'   garage, and costs £'+price+'&lt;br /&gt;');&lt;br /&gt;with (house2) document.write('House 2 has '+rooms+' rooms, '+(garage?'a':'no')+'   garage, and costs £'+price+'&lt;br /&gt;');&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;We define a House function that takes three parameters, rooms, price and garage. The function uses the this keyword to create an object.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;When we call the House function, we assign the result to our variable, which becomes an object.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;So, identical code would be:&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;house1=new Object();&lt;br /&gt;house1.rooms=4;&lt;br /&gt;house1.price=100000;&lt;br /&gt;house1.garage=false;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;We would have to type this in for all houses, which would be very tedious and is why we use the class structure instead.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;When we display the details for a house, I have introduced the ternary operator, '?:'. The ternary operator is a compacted version of:&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;if (garage) str='a'; else str='no';&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;(garage?'a':'no') means if garage is true, return 'a' else return 'no'. Using the ternary operator removes a line of code, and avoids having to create a new variable.&lt;/span&gt;&lt;/p&gt; &lt;h3&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;Class Methods&lt;/span&gt;&lt;/h3&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;The House class we have so far defined only contains object properties. We could add a method to replace the document.write() action we used before. (&lt;a href="http://www.webdevelopersjournal.com/articles/jsintro3/estateagent2.htm" mce_href="http://www.webdevelopersjournal.com/articles/jsintro3/estateagent2.htm"&gt;See example&lt;/a&gt;)&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;br /&gt;&lt;br /&gt;&lt;title&gt;Estate Agent 2&lt;/title&gt;&lt;br /&gt;&lt;script&gt;&lt;br /&gt;function House(name,rooms,price,garage) {&lt;br /&gt;this.name=name;&lt;br /&gt;this.rooms=rooms;&lt;br /&gt;this.price=price;&lt;br /&gt;this.garage=garage;&lt;br /&gt;this.view=view;&lt;br /&gt;}&lt;br /&gt;function view() {&lt;br /&gt;with (this) document.write(name+' has '+rooms+' rooms, '+(garage?'a':'no')+'   garage, and costs £'+price+'&lt;br /&gt;');&lt;br /&gt;}&lt;br /&gt;house1=new House('House 1',4,100000,false);&lt;br /&gt;house2=new House('Big House',5,200000,true);&lt;br /&gt;house1.view();&lt;br /&gt;house2.view();&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;Much better!&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;Note how we must add another property, name, so that we can identify the house in question. This offers more flexibility than re-using the variable name, and the variable name is inaccessible anyway, i.e. it is very difficult, if not impossible, to get the view() function to use the string 'house1'.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" bg="" style="color: rgb(255, 204, 102);" align="left" valign="top" width="34"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;b&gt;Q:85&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bg style="color:#ffcc66;"&gt;&lt;b&gt;&lt;span class="q"&gt;Are namespaces are there in JavaScript?&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;A:81&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" align="justify"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;A namespace is a container and allows you to bundle up all your functionality using a unique name. In JavaScript, a namespace is really just an object that you've attached all further methods, properties and objects. But it is not always necessary to use namespace.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" bg="" style="color: rgb(255, 204, 102);" align="left" valign="top" width="34"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;b&gt;Q:86&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bg style="color:#ffcc66;"&gt;&lt;b&gt;What is JSON? What are the notations used in JSON?&lt;/b&gt;&lt;b&gt;       &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt; &lt;span style=";font-family:Verdana;font-size:85%;"  &gt;A:86&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" align="justify"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;b&gt;JSON&lt;/b&gt; (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the &lt;a href="http://javascript.crockford.com/" mce_href="http://javascript.crockford.com/"&gt;JavaScript   Programming Language&lt;/a&gt;,   &lt;a href="http://www.ecma-international.org/publications/files/ecma-st/ECMA-262.pdf" mce_href="http://www.ecma-international.org/publications/files/ecma-st/ECMA-262.pdf"&gt;Standard   ECMA-262 3rd Edition - December 1999&lt;/a&gt;. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" bg="" style="color: rgb(255, 204, 102);" align="left" valign="top" width="34"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;b&gt;Q:87&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bg style="color:#ffcc66;"&gt;&lt;b&gt;&lt;span class="q"&gt;How to get Query String in PHP for http request?&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;A:87&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;$_GET[]  and $_REQUEST[]&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" bg="" style="color: rgb(255, 204, 102);" align="left" valign="top" width="34"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;b&gt;Q:88&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bg style="color:#ffcc66;"&gt;&lt;b&gt;&lt;span class="q"&gt;How to get the http Request in PHP?&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;A:88&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;When PHP is used on a Web server to handle a HTTP request, it converts information submitted in the HTTP request as predefined variables:&lt;/span&gt; &lt;ul&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;li&gt;$_GET - Associate array of variables submitted with GET method.&lt;/li&gt; &lt;li&gt;$_POST - Associate array of variables submitted with POST method.&lt;/li&gt; &lt;li&gt;$_COOKIE - Associate array of variables submitted as cookies.&lt;/li&gt; &lt;li&gt;$_REQUEST - Associate array of variables from $_GET, $_POST, and $_COOKIE.&lt;/li&gt; &lt;li&gt;$_SERVER - Associate array of all information from the server and the HTTP request.&lt;/li&gt; &lt;/span&gt;&lt;/ul&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" bg="" style="color: rgb(255, 204, 102);" align="left" valign="top" width="34"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;b&gt;Q:89&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bg style="color:#ffcc66;"&gt;&lt;b&gt;&lt;span class="q"&gt; How you provide security for PHP application?&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;A:89&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;There are many ways to accomplish the security tasks but the most common 7 ways are1. Validate Input. Never trust your user and always filter input before taking it to any operation.2. Provide access control.3. Session ID protection4. preventing Cross Site Scripting (XSS) flaws&lt;/span&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;5. SQL injection vulnerabilities.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;6. Turning off error reporting and exposing to the site for hackers. Instead use log file to catch exceptions&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;7. Effective Data handling&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" bg="" style="color: rgb(255, 204, 102);" align="left" valign="top" width="34"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;b&gt;Q:90&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bg style="color:#ffcc66;"&gt;&lt;b&gt;&lt;span class="q"&gt;What is SQL Injection in PHP security?&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="q"&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" valign="top"&gt;&lt;b&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;A:90&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" align="justify" valign="top"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;SQL injection attacks are extremely simple to defend against, but many applications are still vulnerable. Consider the following SQL statement:&lt;/span&gt; &lt;pre&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;This query is constructed with &lt;tt&gt;$_POST&lt;/tt&gt;, which should immediately look suspicious.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;Assume that this query is creating a new account. The user provides a desired username and an email address. The registration application generates a temporary password and emails it to the user to verify the email address. Imagine that the user enters the following as a username:&lt;/span&gt;&lt;/p&gt; &lt;pre&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;bad_guy', 'mypass', ''), ('good_guy&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;This certainly doesn't look like a valid username, but with no data filtering in place, the application can't tell. If a valid email address is given (&lt;tt&gt;shiflett@php.net&lt;/tt&gt;, for example), and &lt;tt&gt;1234&lt;/tt&gt; is what the application generates for the password, the SQL statement becomes the following:&lt;/span&gt;&lt;/p&gt; &lt;pre&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;Rather than the intended action of creating a single account (&lt;tt&gt;good_guy&lt;/tt&gt;) with a valid email address, the application has been tricked into creating two accounts, and the user supplied every detail of the &lt;tt&gt;bad_guy&lt;/tt&gt; account.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;While this particular example might not seem so harmful, it should be clear that worse things could happen once an attacker can make modifications to your SQL statements.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;For example, depending on the database you are using, it might be possible to send multiple queries to the database server in a single call. Thus, a user can potentially terminate the existing query with a semicolon and follow this with a query of the user's choosing.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;MySQL, until recently, does not allow multiple queries, so this particular risk is mitigated. Newer versions of MySQL allow multiple queries, but the corresponding PHP extension (&lt;tt&gt;ext/mysqli&lt;/tt&gt;) requires that you use a separate function if you want to send multiple queries (&lt;tt&gt;mysqli_multi_query()&lt;/tt&gt; instead of &lt;tt&gt;mysqli_query()&lt;/tt&gt;). Only allowing a single query is safer, because it limits what an attacker can potentially do.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;Protecting against SQL injection is easy:&lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;li&gt;Filter your data.This cannot be overstressed. With good data filtering in place, most security concerns are mitigated, and some are practically eliminated.&lt;/li&gt; &lt;li&gt;Quote your data.If your database allows it (MySQL does), put single quotes around all values in your SQL statements, regardless of the data type.&lt;/li&gt; &lt;li&gt;Escape your data.Sometimes valid data can unintentionally interfere with the format of the SQL statement itself. Use &lt;tt&gt;mysql_escape_string()&lt;/tt&gt; or an escaping function         native to your particular database. If there isn't a specific one,         &lt;tt&gt;addslashes()&lt;/tt&gt; is a good last resort.&lt;/li&gt; &lt;/span&gt;&lt;/ul&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" valign="top"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid" valign="top"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" bg="" style="color: rgb(255, 204, 102);" align="left" valign="top" width="34"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;b&gt;Q:91&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;&lt;span class="q"&gt;What is cross site Scripting?&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="q"&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="q"&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" valign="top"&gt;&lt;b&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;A:91&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" align="justify" valign="top"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;span class="txt"&gt;To understand what Cross Site Scripting is, let’s see a usual situation, common to many sites. Let’s say we are taking some information passed in on a querystring (the string after the (?) character within a URL), with the purpose of displaying the content of a variable, for example, the visitor’s name:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new,courier,mono;"&gt;http://www.yourdomain.com/welcomedir/welcomepage.php?name=John&lt;/span&gt;&lt;br /&gt;As we can see in this simple querystring, we are passing the visitor’s name as a parameter in the URL, and then displaying it on our “welcomepage.php” page with the following PHP code:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new,courier,mono;"&gt; &lt;p&gt;&lt;span style="font-family:courier new,courier,mono;"&gt;echo ‘Welcome to our site ’ . stripslashes($_GET[‘name’]);&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:courier new,courier,mono;"&gt;?&gt;&lt;/span&gt;&lt;br /&gt;The result of this snippet is shown below:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-family:courier new,courier,mono;"&gt;Welcome to our site John&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;This is pretty simple and straightforward. We’re displaying the content of the “name” variable, by using the $_GET superglobal PHP array, as we have done probably hundreds of times. Everything seems to be fine. Now, what’s wrong with this code? Nothing really. But let’s modify the querystring by replacing our visitor’s name passed in the URL:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new,courier,mono;"&gt;http://www.yourdomain.com/welcomedir/&lt;br /&gt;welcomepage.php?name=John&lt;/span&gt;&lt;br /&gt;with something like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new,courier,mono;"&gt;http://www.yourdomain.com/welcomedir/&lt;br /&gt;welcomepage.php?name=&lt;br /&gt;&lt;script language="&lt;a" href="http://www.devshed.com/#" mce_href="http://www.devshed.com/#" target="_blank" class="iAs"&gt;javascript&lt;/a&gt;&gt;alert&lt;br /&gt;(‘Hey, you are going to be hijacked!’);&lt;/script&gt;&lt;/span&gt;&lt;br /&gt;Do you remember the PHP code included in our “welcome.php” page? Yes, you’re correct. When we modify the querystring, the following code is executed:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new,courier,mono;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:courier new,courier,mono;"&gt;echo ‘Welcome to our site ‘ .&lt;br /&gt;&lt;script language="javascript"&gt; alert(‘Hey, you are going&lt;br /&gt;to be hijacked!’);&lt;/script&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:courier new,courier,mono;"&gt;?&gt;&lt;/span&gt;&lt;br /&gt;The output of this code is an alert JavaScript box telling you “Hey, you are going be hijacked!” after the “Welcome to our site” phrase.&lt;/p&gt; &lt;p&gt;Very ugly stuff, right? That’s a simple example of the Cross Site Scripting vulnerability. This means that any pasted JavaScript code into the URL will be executed happily with no complaints at all.&lt;/p&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" valign="top"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid" valign="top"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" bg="" style="color: rgb(255, 204, 102);" align="left" valign="top" width="34"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;b&gt;Q:92&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;&lt;span class="q"&gt;Which method do you follow to get a record from a million records? (Searching, .... not from database, from an array in php)&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="q"&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="q"&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="q"&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" valign="top"&gt;&lt;b&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;A:92&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" valign="top"&gt;use &lt;b&gt;array_search(), &lt;/b&gt;&lt;b&gt;array_keys()&lt;/b&gt;, &lt;b&gt;array_values()&lt;/b&gt;, &lt;b&gt;array_key_exists()&lt;/b&gt;, and &lt;b&gt;in_array()&lt;/b&gt;.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" valign="top"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid" valign="top"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" bg="" style="color: rgb(255, 204, 102);" align="left" valign="top" width="34"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;b&gt;Q:93&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;&lt;span class="q"&gt;Which sorting method is lowest time consumable?&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="q"&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="q"&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="q"&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" valign="top"&gt;&lt;b&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;A:93&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" valign="top"&gt;HeapSort, Merge sort are the lowest time consumable sorting algorithm.&lt;img src="http://www.devx.com/assets/articlefigs/8269.gif" mce_src="http://www.devx.com/assets/articlefigs/8269.gif" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" valign="top"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid" valign="top"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" bg="" style="color: rgb(255, 204, 102);" align="left" valign="top" width="34"&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;&lt;b&gt;Q:94&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;&lt;span class="q"&gt;Which sorting method is lowest memory consumable?&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="q"&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="q"&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="q"&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" valign="top"&gt;&lt;b&gt;&lt;span style=";font-family:Verdana;font-size:85%;"  &gt;A:94&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" valign="top"&gt;&lt;img src="http://www.devx.com/assets/articlefigs/8269.gif" mce_src="http://www.devx.com/assets/articlefigs/8269.gif" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3891726027537827996-3356276287507746307?l=booleandreams.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://booleandreams.blogspot.com/feeds/3356276287507746307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3891726027537827996&amp;postID=3356276287507746307' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3891726027537827996/posts/default/3356276287507746307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3891726027537827996/posts/default/3356276287507746307'/><link rel='alternate' type='text/html' href='http://booleandreams.blogspot.com/2007/08/php-mysql-interview-question-2.html' title='PHP-MySQL Interview Question - 2'/><author><name>PHP Tutor</name><uri>http://www.blogger.com/profile/16269878958363853388</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><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3891726027537827996.post-852657939925424054</id><published>2007-08-20T01:57:00.000-07:00</published><updated>2007-08-20T01:59:46.573-07:00</updated><title type='text'>PHP-MySQL Interview Question - 1</title><content type='html'>&lt;p&gt;Last few days I have been working to compile a question and answer set for PHP-MySQL interview questions. There are roughly 150 questions and i will be adding more as days to come. These questions and answers are compiled from different online resources. I am planning to make it a PDF version so that people download it and go through it offline. I hope i will be able to finish it soon.&lt;/p&gt; &lt;p&gt;&lt;b&gt;NB: If you want to add any question, please add it to the comments section. I want to make it a big repository.  &lt;/b&gt;&lt;/p&gt; &lt;p&gt;&lt;b&gt;Here is the first set of 80 Questions and answer.&lt;/b&gt;&lt;/p&gt; &lt;table class="mceVisualAid" style="font-size: 8pt; font-family: Verdana;" border="0" cellpadding="3" cellspacing="0" width="525"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td class="mceVisualAid" align="left" bg valign="top" width="34" style="color:#ffcc66;"&gt;&lt;span style="font-family:Verdana;font-size:78%;"&gt;&lt;b&gt;Q:1&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What are the differences between Get and post methods in form submitting.&lt;br /&gt;give the case where we can use get and we can use post methods?&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;&lt;span style="font-family:Verdana;font-size:78%;"&gt;A:1&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt; &lt;h3&gt;&lt;span style="font-size:85%;color:#6666ff;"&gt;When to use GET or POST&lt;/span&gt;&lt;/h3&gt; &lt;p align="justify"&gt;The HTML 2.0 specification says, in section Form&lt;br /&gt;Submission (and the HTML 4.0 specification repeats this with minor&lt;br /&gt;stylistic changes):&lt;/p&gt; &lt;p align="justify"&gt;--&gt;If the processing of a form is idempotent&lt;br /&gt;(i.e. it has no lasting observable effect on the state of the&lt;br /&gt;world), then the form method should be GET. Many database searches&lt;br /&gt;have no visible side-effects and make ideal applications of query&lt;br /&gt;forms.&lt;br /&gt;--&lt;br /&gt;--&gt;If the service associated with the processing of a form has side&lt;br /&gt;effects (for example, modification of a database or subscription to&lt;br /&gt;a service), the method should be POST.&lt;/p&gt; &lt;h3 align="justify"&gt;&lt;span style="font-size:85%;color:#6666ff;"&gt;How the form data is transmitted?&lt;/span&gt;&lt;/h3&gt; &lt;p align="justify"&gt;quotation from the HTML 4.0 specification&lt;/p&gt; &lt;p align="justify"&gt;--&gt; If the method is "get" - -, the user agent&lt;br /&gt;takes the value of action, appends a ? to it, then appends the form&lt;br /&gt;data set, encoded using the application/x-www-form-urlencoded&lt;br /&gt;content type. The user agent then traverses the link to this URI. In&lt;br /&gt;this scenario, form data are restricted to ASCII codes.&lt;br /&gt;--&gt; If the method is "post" --, the user agent conducts an HTTP post&lt;br /&gt;transaction using the value of the action attribute and a message&lt;br /&gt;created according to the content type specified by the enctype&lt;br /&gt;attribute.&lt;/p&gt; &lt;h3 align="justify"&gt;&lt;span style="font-size:85%;color:#6666ff;"&gt;Quote from CGI FAQ&lt;/span&gt;&lt;/h3&gt; &lt;p align="justify"&gt;Firstly, the the HTTP protocol specifies&lt;br /&gt;differing usages for the two methods. GET requests should always be&lt;br /&gt;idempotent on the server. This means that whereas one GET request&lt;br /&gt;might (rarely) change some state on the Server, two or more&lt;br /&gt;identical requests will have no further effect.&lt;/p&gt; &lt;p align="justify"&gt;This is a theoretical point which is also good&lt;br /&gt;advice in practice. If a user hits "reload" on his/her browser, an&lt;br /&gt;identical request will be sent to the server, potentially resulting&lt;br /&gt;in two identical database or&lt;br /&gt;guestbook entries, counter increments, etc. Browsers may reload a&lt;br /&gt;GET URL automatically, particularly if cacheing is disabled (as is&lt;br /&gt;usually the case with CGI output), but will typically prompt the&lt;br /&gt;user before&lt;br /&gt;re-submitting a POST request. This means you're far less likely to&lt;br /&gt;get inadvertently-repeated entries from POST.&lt;/p&gt; &lt;p align="justify"&gt;GET is (in theory) the preferred method for&lt;br /&gt;idempotent operations, such as querying a database, though it&lt;br /&gt;matters little if you're using a form. There is a further practical&lt;br /&gt;constraint that many systems have built-in limits to the length of a&lt;br /&gt;GET request they can handle: when the total size of a request (URL+params)&lt;br /&gt;approaches or exceeds 1Kb, you are well-advised to use POST in any&lt;br /&gt;case.&lt;/p&gt; &lt;p align="justify"&gt;I would prefer POST when I don't want the status to&lt;br /&gt;be change when user resubmits. And GET&lt;br /&gt;when it does not matter.&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:2&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;Who is the father of PHP and explain the changes in PHP versions?&lt;br /&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:2&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;Rasmus Lerdorf is known as the father of PHP.PHP/FI 2.0 is an early and no longer supported version of PHP. PHP 3&lt;br /&gt;is the successor to PHP/FI 2.0 and is a lot nicer. PHP 4 is the current&lt;br /&gt;generation of PHP, which uses the&lt;br /&gt;Zend engine&lt;br /&gt;under the&lt;br /&gt;hood. PHP 5 uses&lt;br /&gt;Zend engine 2 which,&lt;br /&gt;among other things, offers many additionalOOP features&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:3&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we submit a form without a submit button? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:3&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;The main idea behind this is to use Java script submit() function in&lt;br /&gt;order to submit the form without explicitly clicking any submit button.&lt;br /&gt;You can attach the document.formname.submit() method to onclick,&lt;br /&gt;onchange events of different inputs and perform the form submission. you&lt;br /&gt;can even built a timer function where you can automatically submit the&lt;br /&gt;form after xx seconds once the loading is done (can be seen in online&lt;br /&gt;test sites).&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:4&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;In how many ways we can retrieve the data in the result set of&lt;br /&gt;MySQL using PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:4&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;You can do it by 4 Ways1. mysql_fetch_row.&lt;br /&gt;2. mysql_fetch_array&lt;br /&gt;3. mysql_fetch_object&lt;br /&gt;4. mysql_fetch_assoc&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:5&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What is the difference between mysql_fetch_object and&lt;br /&gt;mysql_fetch_array? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:5&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;b&gt;mysql_fetch_object()&lt;/b&gt; is similar to&lt;b&gt;mysql_fetch_array()&lt;/b&gt;, with one difference -&lt;br /&gt;an object is returned, instead of an array. Indirectly, that means that&lt;br /&gt;you can only access the data by the field names, and not by their&lt;br /&gt;offsets (numbers are illegal property names).&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:6&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What is the difference between $message and $$message? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:6&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;It is a classic example of PHP's variable variables. take the&lt;br /&gt;following example.$message = "Mizan";$$message = "is a moderator of PHPXperts.";$message is a simple PHP variable that we are used to. But the&lt;br /&gt;$$message is not a very familiar face. It creates a variable name $mizan&lt;br /&gt;with the value "is a moderator of PHPXperts." assigned. break it like&lt;br /&gt;this${$message} =&gt; $mizanSometimes it is convenient to be able to have variable variable&lt;br /&gt;names. That is, a variable name which can be set and used dynamically.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:7&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we extract string ‘abc.com ‘ from a string ‘http://info@abc.com’&lt;br /&gt;using regular expression of PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:7&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;preg_match("/^http:\/\/.+@(.+)$/",'http://info@abc.com',$found);&lt;br /&gt;echo $found[1];&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:8&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we create a database using PHP and MySQL? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:8&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;We can create MySQL database with the use of&lt;br /&gt;mysql_create_db(“Database Name”)&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:9&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What are the differences between require and include,&lt;br /&gt;include_once and require_once? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:9&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt; &lt;p class="sect1"&gt;The &lt;b&gt;include()&lt;/b&gt; statement includes&lt;br /&gt;and evaluates the specified file.The documentation below also applies to&lt;br /&gt;&lt;b&gt;require()&lt;/b&gt;. The two constructs&lt;br /&gt;are identical in every way except how they handle&lt;br /&gt;failure. &lt;b&gt;include()&lt;/b&gt; produces a&lt;br /&gt;Warning while &lt;b&gt;require()&lt;/b&gt; results&lt;br /&gt;in a Fatal Error. In other words, use&lt;br /&gt;&lt;b&gt;require()&lt;/b&gt; if you want a missing&lt;br /&gt;file to halt processing of the page. &lt;b&gt;&lt;br /&gt;include()&lt;/b&gt; does not behave this way, the script will&lt;br /&gt;continue regardless.&lt;/p&gt; &lt;p class="sect1"&gt;The &lt;b&gt;include_once()&lt;/b&gt;&lt;br /&gt;statement includes and evaluates the&lt;br /&gt;specified file during the execution of&lt;br /&gt;the script. This is a behavior similar&lt;br /&gt;to the &lt;b&gt;include()&lt;/b&gt;&lt;br /&gt;statement, with the only difference&lt;br /&gt;being that if the code from a file has&lt;br /&gt;already been included, it will not be&lt;br /&gt;included again. As the name suggests, it&lt;br /&gt;will be included just once.&lt;b&gt;include_once()&lt;/b&gt;&lt;br /&gt;should be used in cases where the same&lt;br /&gt;file might be included and evaluated&lt;br /&gt;more than once during a particular&lt;br /&gt;execution of a script, and you want to&lt;br /&gt;be sure that it is included exactly once&lt;br /&gt;to avoid problems with function&lt;br /&gt;redefinitions, variable value&lt;br /&gt;reassignments, etc.&lt;/p&gt; &lt;p&gt;&lt;b&gt;require_once()&lt;/b&gt;&lt;br /&gt;should be used in cases where the same&lt;br /&gt;file might be included and evaluated&lt;br /&gt;more than once during a particular&lt;br /&gt;execution of a script, and you want to&lt;br /&gt;be sure that it is included exactly once&lt;br /&gt;to avoid problems with function&lt;br /&gt;redefinitions, variable value&lt;br /&gt;reassignments, etc.&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:10&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;Can we use include (”abc.PHP”) two times in a PHP page “makeit.PHP”?&lt;br /&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:10&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;Yes we can use include() more than one time in any page though it is&lt;br /&gt;not a very good practice.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:11&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What are the different tables present in MySQL, which type of&lt;br /&gt;table is generated when we are creating a table in the following syntax:&lt;br /&gt;create table employee (eno int(2),ename varchar(10)) ? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:11&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;Total 5 types of tables we can create&lt;br /&gt;1. MyISAM&lt;br /&gt;2. Heap&lt;br /&gt;3. Merge&lt;br /&gt;4. INNO DB&lt;br /&gt;5. ISAM&lt;br /&gt;MyISAM is the default storage engine as of MySQL 3.23 and as a result if&lt;br /&gt;we do not specify the table name explicitly it will be assigned to the&lt;br /&gt;default engine.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:12&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;Functions in IMAP, POP3 AND LDAP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:12&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;You can find these specific information in PHP Manual.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:13&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can I execute a PHP script using command line? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:13&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;As of version 4.3.0, PHP supports a new SAPI type (Server&lt;br /&gt;Application Programming Interface) named CLI which means Command Line&lt;br /&gt;Interface. Just run the PHP CLI (Command Line Interface) program and&lt;br /&gt;provide the PHP script file name as the command line argument. For&lt;br /&gt;example, "php myScript.php", assuming "php" is the command to invoke the&lt;br /&gt;CLI program.&lt;br /&gt;Be aware that if your PHP script was written for the Web CGI interface,&lt;br /&gt;it may not execute properly in command line environment.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:14&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;Suppose your Zend engine supports the mode &lt;? ?&gt; Then how can u&lt;br /&gt;configure your PHP Zend engine to support &lt;?PHP ?&gt; mode ? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:14&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;In php.ini file:&lt;br /&gt;set&lt;br /&gt;&lt;b&gt;short_open_tag=on&lt;/b&gt;&lt;br /&gt;to make PHP support&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:15&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;Shopping cart online validation i.e. how can we configure Paypal,&lt;br /&gt;etc.? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:15&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;We can find the detail documentation about different paypal&lt;br /&gt;integration process at the following site &lt;h2 class="r"&gt;&lt;b&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;PayPal&lt;/span&gt;&lt;span style="font-size:85%;"&gt; PHP&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;SDK : &lt;a href="http://www.paypaldev.org/" mce_href="http://www.paypaldev.org"&gt;http://www.paypaldev.org&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:16&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What is meant by nl2br()? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:16&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;Inserts HTML line breaks (&lt;br /&gt;) before all newlines in a string&lt;br /&gt;string nl2br (string); Returns string with ” inserted before all&lt;br /&gt;newlines. For example: echo nl2br("god bless\n you") will output "god&lt;br /&gt;bless &lt;br /&gt; you" to your browser.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:17&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;Draw the architecture of Zend engine? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:17&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;The Zend Engine is the internal compiler and runtime engine used by&lt;br /&gt;PHP4. Developed by Zeev Suraski and Andi Gutmans, the Zend Engine is an&lt;br /&gt;abbreviation of their names. In the early days of PHP4, it worked as&lt;br /&gt;follows:&lt;a href="http://photos1.blogger.com/blogger/6545/2077/1600/Image2.gif" mce_href="http://photos1.blogger.com/blogger/6545/2077/1600/Image2.gif"&gt;&lt;br /&gt;&lt;img src="http://photos1.blogger.com/blogger/6545/2077/320/Image2.gif" mce_src="http://photos1.blogger.com/blogger/6545/2077/320/Image2.gif" border="0" /&gt;&lt;/a&gt;The PHP script was loaded by the Zend Engine and compiled into Zend&lt;br /&gt;opcode. Opcodes, short for operation codes, are low level binary&lt;br /&gt;instructions. Then the opcode was executed and the HTML generated sent&lt;br /&gt;to the client. The opcode was flushed from memory after execution.Today, there are a multitude of products and techniques to help you&lt;br /&gt;speed up this process. In the following diagram, we show the how modern&lt;br /&gt;PHP scripts work; all the shaded boxes are optional.&lt;a href="http://photos1.blogger.com/blogger/6545/2077/1600/php-zend.gif" mce_href="http://photos1.blogger.com/blogger/6545/2077/1600/php-zend.gif"&gt;&lt;br /&gt;&lt;img src="http://photos1.blogger.com/blogger/6545/2077/400/php-zend.jpg" mce_src="http://photos1.blogger.com/blogger/6545/2077/400/php-zend.jpg" border="0" /&gt;&lt;/a&gt;PHP Scripts are loaded into memory and compiled into Zend opcodes.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:18&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What are the current versions of apache, PHP, and MySQL? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:18&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;As of February, 2007 the current versions arePHP: php5.2.1&lt;br /&gt;MySQL: MySQL 5.2&lt;br /&gt;Apache: Apache 2.2.4Note: visit &lt;a href="http://www.php.net/" mce_href="http://www.php.net"&gt;www.php.net&lt;/a&gt;,&lt;br /&gt;&lt;a href="http://dev.mysql.com/downloads/mysql/" mce_href="http://dev.mysql.com/downloads/mysql/"&gt;&lt;br /&gt;http://dev.mysql.com/downloads/mysql/&lt;/a&gt;,&lt;br /&gt;&lt;a href="http://www.apache.org/" mce_href="http://www.apache.org"&gt;www.apache.org&lt;/a&gt; to get current&lt;br /&gt;versions.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:19&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What are the reasons for selecting lamp (Linux, apache, MySQL,&lt;br /&gt;PHP) instead of combination of other software programs, servers and&lt;br /&gt;operating systems? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:19&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;All of those are open source resource. Security of Linux is very&lt;br /&gt;very more than windows. Apache is a better server that IIS both in&lt;br /&gt;functionality and security. MySQL is world most popular open source&lt;br /&gt;database. PHP is more faster that asp or any other scripting language.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:20&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we encrypt and decrypt a data present in a MySQL table&lt;br /&gt;using MySQL? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:20&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;AES_ENCRYPT () and AES_DECRYPT ()&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:21&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we encrypt the username and password using PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:21&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;The functions in this section perform encryption and decryption, and&lt;br /&gt;compression and uncompression: &lt;p class="informaltable"&gt; &lt;table border="1"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td&gt;&lt;span class="bold"&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;encryption&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span class="bold"&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;decryption&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;AES_ENCRYT()&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;AES_DECRYPT()&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;ENCODE()&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;DECODE()&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;DES_ENCRYPT()&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;DES_DECRYPT()&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;ENCRYPT()&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;Not available&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;MD5()&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;Not available&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;OLD_PASSWORD()&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;Not available&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;PASSWORD()&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;Not available&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;SHA() or SHA1()&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;Not available&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;Not available&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;UNCOMPRESSED_LENGTH()&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:22&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What are the features and advantages of object-oriented&lt;br /&gt;programming? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:22&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;One of the main advantages of OO programming is its ease of&lt;br /&gt;modification; objects can easily be modified and added to a system there&lt;br /&gt;by reducing maintenance costs. OO programming is also considered to be&lt;br /&gt;better at modeling the real world than is procedural programming. It&lt;br /&gt;allows for more complicated and flexible interactions. OO systems are&lt;br /&gt;also easier for non-technical personnel to understand and easier for&lt;br /&gt;them to participate in the maintenance and enhancement of a system&lt;br /&gt;because it appeals to natural human cognition patterns.&lt;br /&gt;For some systems, an OO approach can speed development time since many&lt;br /&gt;objects are standard across systems and can be reused. Components that&lt;br /&gt;manage dates, shipping, shopping carts, etc. can be purchased and easily&lt;br /&gt;modified for a specific system&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:23&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What are the differences between procedure-oriented languages and&lt;br /&gt;object-oriented languages? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:23&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;Traditional programming has the following characteristics:Functions are written sequentially, so that a change in programming can&lt;br /&gt;affect any code that follows it.&lt;br /&gt;If a function is used multiple times in a system (i.e., a piece of code&lt;br /&gt;that manages the date), it is often simply cut and pasted into each&lt;br /&gt;program (i.e., a change log, order function, fulfillment system, etc).&lt;br /&gt;If a date change is needed (i.e., Y2K when the code needed to be changed&lt;br /&gt;to handle four numerical digits instead of two), all these pieces of&lt;br /&gt;code must be found, modified, and tested.&lt;br /&gt;Code (sequences of computer instructions) and data (information on which&lt;br /&gt;the instructions operates on) are kept separate. Multiple sets of code&lt;br /&gt;can access and modify one set of data. One set of code may rely on data&lt;br /&gt;in multiple places. Multiple sets of code and data are required to work&lt;br /&gt;together. Changes made to any of the code sets and data sets can cause&lt;br /&gt;problems through out the system.Object-Oriented programming takes a radically different approach:Code and data are merged into one indivisible item – an object (the&lt;br /&gt;term "component" has also been used to describe an object.) An object is&lt;br /&gt;an abstraction of a set of real-world things (for example, an object may&lt;br /&gt;be created around "date") The object would contain all information and&lt;br /&gt;functionality for that thing (A date&lt;br /&gt;object it may contain labels like January, February, Tuesday, Wednesday.&lt;br /&gt;It may contain functionality that manages leap years, determines if it&lt;br /&gt;is a business day or a holiday, etc., See Fig. 1). Ideally, information&lt;br /&gt;about a particular thing should reside in only one place in a system.&lt;br /&gt;The information within an object is encapsulated (or hidden) from the&lt;br /&gt;rest of the system.&lt;br /&gt;A system is composed of multiple objects (i.e., date function, reports,&lt;br /&gt;order processing, etc., See Fig 2). When one object needs information&lt;br /&gt;from another object, a request is sent asking for specific information.&lt;br /&gt;(for example, a report object may need to know what today’s date is and&lt;br /&gt;will send a request to the date object) These requests are called&lt;br /&gt;messages and each object has an interface that manages messages.&lt;br /&gt;OO programming languages include features such as "class", "instance",&lt;br /&gt;"inheritance", and "polymorphism" that increase the power and&lt;br /&gt;flexibility of an object.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:24&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What is the use of friend function? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:24&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;Sometimes a function is best shared among a number of different&lt;br /&gt;classes. Such functions can be declared either as member functions of&lt;br /&gt;one class or as global functions. In either case they can be set to be&lt;br /&gt;friends of other classes, by using a friend specifier in the class that&lt;br /&gt;is admitting them. Such functions can use all attributes of the class&lt;br /&gt;which names them as a friend, as if they were themselves members of that&lt;br /&gt;class.&lt;br /&gt;A friend declaration is essentially a prototype for a member function,&lt;br /&gt;but instead of requiring an implementation with the name of that class&lt;br /&gt;attached by the double colon syntax, a global function or member&lt;br /&gt;function of another class provides the match.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:25&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What are the differences between public, private, protected,&lt;br /&gt;static, transient, final and volatile? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:25&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;b&gt;Public:&lt;/b&gt; Public declared items can be accessed everywhere.&lt;br /&gt;&lt;b&gt;Protected:&lt;/b&gt; Protected limits access to inherited and parent&lt;br /&gt;classes (and to the class that defines the item).&lt;br /&gt;&lt;b&gt;Private:&lt;/b&gt; Private limits visibility only to the class that defines&lt;br /&gt;the item.&lt;br /&gt;&lt;b&gt;Static:&lt;/b&gt; A static variable exists only in a local function scope,&lt;br /&gt;but it does not lose its value when program execution leaves this scope.&lt;br /&gt;&lt;b&gt;Final:&lt;/b&gt; Final keyword prevents child classes from overriding a&lt;br /&gt;method by prefixing the definition with final. If the class itself is&lt;br /&gt;being defined final then it cannot be extended.&lt;br /&gt;&lt;b&gt;transient:  &lt;/b&gt;A transient variable is a variable that may not&lt;br /&gt;be serialized. &lt;b&gt;&lt;br /&gt;volatile:&lt;/b&gt; a variable that might be concurrently modified by multiple&lt;br /&gt;threads should be declared volatile. Variables declared to be volatile&lt;br /&gt;will not be optimized by the compiler because their value can change at&lt;br /&gt;any time.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:26&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What are the different types of errors in PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:26&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;Three are three types of errors:1. Notices: These are trivial,&lt;br /&gt;non-critical errors that PHP encounters while executing a script - for&lt;br /&gt;example, accessing a variable that has not yet been defined. By default,&lt;br /&gt;such errors are not displayed to the user at all - although, as you will&lt;br /&gt;see, you can change this default behavior.2. Warnings: These are more serious errors - for example, attempting&lt;br /&gt;to include() a file which does not exist. By default, these errors are&lt;br /&gt;displayed to the user, but they do not result in script termination.3. Fatal errors: These are critical errors - for example,&lt;br /&gt;instantiating an object of a non-existent class, or calling a&lt;br /&gt;non-existent function. These errors cause the immediate termination of&lt;br /&gt;the script, and PHP's default behavior is to display them to the user&lt;br /&gt;when they take place.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:27&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What is the functionality of the function strstr and stristr? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:27&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;strstr: &lt;p class="refsect1"&gt;Returns part of &lt;var&gt;haystack&lt;/var&gt;&lt;br /&gt;string from the first occurrence of&lt;br /&gt;&lt;var&gt;needle&lt;/var&gt; to the end of&lt;br /&gt;&lt;var&gt;haystack&lt;/var&gt;.If &lt;var&gt;needle&lt;/var&gt; is not found,&lt;br /&gt;returns &lt;tt&gt;FALSE&lt;/tt&gt;.&lt;/p&gt; &lt;p&gt;If &lt;var&gt;needle&lt;/var&gt; is not a&lt;br /&gt;string, it is converted to an integer and applied as the&lt;br /&gt;ordinal value of a character.&lt;/p&gt; &lt;p class="note"&gt;This function is case-sensitive. For&lt;br /&gt;case-insensitive searches, use&lt;br /&gt;&lt;b&gt;stristr()&lt;/b&gt;.&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:28&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What are the differences between PHP 3 and PHP 4 and PHP 5? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:28&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;Please read the release notes at&lt;br /&gt;&lt;a href="http://php.net./" mce_href="http://php.net." rel="nofollow"&gt;http://www.php.net.&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:29&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we convert asp pages to PHP pages? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:29&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;there are lots of tools available for asp to PHP conversion. you can&lt;br /&gt;search Google for that. the best one is available  at&lt;a href="http://asp2php.naken.cc./" mce_href="http://asp2php.naken.cc./"&gt;http://asp2php.naken.cc./&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:30&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What is the functionality of the function htmlentities? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:30&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;Convert all applicable characters to HTML entities&lt;br /&gt;This function is identical to htmlspecialchars() in all ways, except&lt;br /&gt;with htmlentities(), all characters which have HTML character entity&lt;br /&gt;equivalents are translated into these entities.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:31&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we get second of the current time using date function?&lt;br /&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:31&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;$second = date("s");&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:32&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we convert the time zones using PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:32&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;tt&gt;By using date_default_timezone_get&lt;/tt&gt; and &lt;tt&gt;&lt;br /&gt;date_default_timezone_set function on PHP 5.1.0&lt;/tt&gt; &lt;pre&gt;&lt;?php&lt;br /&gt;// Discover what 8am in Tokyo relates to on the East Coast of the US   &lt;br /&gt;&lt;br /&gt;// Set the default timezone to Tokyo time:&lt;br /&gt;date_default_timezone_set('Asia/Tokyo');   &lt;br /&gt;&lt;br /&gt;// Now generate the timestamp for that particular timezone, on Jan 1st, 2000&lt;br /&gt;$stamp = mktime(8, 0, 0, 1, 1, 2000);   &lt;br /&gt;&lt;br /&gt;// Now set the timezone back to US/Eastern&lt;br /&gt;date_default_timezone_set('US/Eastern');   &lt;br /&gt;&lt;br /&gt;// Output the date in a standard format (RFC1123), this will print:&lt;br /&gt;// Fri, 31 Dec 1999 18:00:00 EST&lt;br /&gt;echo '&lt;p&gt;', date(DATE_RFC1123, $stamp) ,'&lt;/p&gt;';?&gt;&lt;/pre&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:33&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What is meant by urlencode and urldocode? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:33&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;URLencode returns a string in which all non-alphanumeric characters&lt;br /&gt;except &lt;tt&gt;-_.&lt;/tt&gt; have been replaced with a percent (&lt;tt&gt;%&lt;/tt&gt;)&lt;br /&gt;sign followed by two hex digits and spaces encoded as plus (&lt;tt&gt;+&lt;/tt&gt;)&lt;br /&gt;signs. It is encoded the same way that the posted data from a WWW form&lt;br /&gt;is encoded, that is the same way as in &lt;tt&gt;&lt;br /&gt;application/x-www-form-urlencoded&lt;/tt&gt; media type. &lt;p class="refsect1"&gt;urldecode decodes any &lt;tt&gt;%&lt;i&gt;&lt;tt&gt;##&lt;/tt&gt;&lt;/i&gt;&lt;/tt&gt;&lt;br /&gt;encoding in the given string.&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:34&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What is the difference between the functions unlink and unset?&lt;br /&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:34&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;unlink() deletes the given file from the file system.&lt;br /&gt;unset() makes a variable undefined.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:35&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we register the variables into a session? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:35&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;$_SESSION[’name’] = “Mizan”;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:36&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we get the properties (size, type, width, height) of an&lt;br /&gt;image using PHP image functions? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:36&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;To know the Image type use exif_imagetype () function&lt;br /&gt;To know the Image size use getimagesize () function&lt;br /&gt;To know the image width use imagesx () function&lt;br /&gt;To know the image height use imagesy() function t&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:37&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we get the browser properties using PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:37&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;By using &lt;span&gt;&lt;code&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;$_SERVER['HTTP_USER_AGENT']&lt;span style="color: rgb(0, 119, 0);"&gt;&lt;br /&gt;&lt;/span&gt;variable&lt;span style="color: rgb(0, 119, 0);"&gt;. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" height="23" valign="top" width="34"&gt;&lt;b&gt;Q:38&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66" height="23"&gt;&lt;b&gt;What is the maximum size of a file that can be uploaded using PHP&lt;br /&gt;and how can we change this? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:38&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;By default the maximum size is 2MB. and we can change the following&lt;br /&gt;setup at php.iniupload_max_filesize = 2M&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:39&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we increase the execution time of a PHP script? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:39&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;by changing the following setup at php.inimax_execution_time = 30&lt;br /&gt;; Maximum execution time of each script, in seconds&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:40&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we take a backup of a MySQL table and how can we restore&lt;br /&gt;it. ? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:40&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;To backup: BACKUP TABLE tbl_name[,tbl_name…] TO&lt;br /&gt;‘/path/to/backup/directory’&lt;br /&gt;RESTORE TABLE tbl_name[,tbl_name…] FROM ‘/path/to/backup/directory’mysqldump: Dumping Table Structure and DataUtility to dump a database or a collection of database for backup or&lt;br /&gt;for transferring the data to another SQL server (not necessarily a MySQL&lt;br /&gt;server). The dump will contain SQL statements to create the table and/or&lt;br /&gt;populate the table.&lt;br /&gt;-t, –no-create-info&lt;br /&gt;Don’t write table creation information (the CREATE TABLE statement).&lt;br /&gt;-d, –no-data&lt;br /&gt;Don’t write any row information for the table. This is very useful if&lt;br /&gt;you just want to get a dump of the structure for a table!&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:41&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we optimize or increase the speed of a MySQL select&lt;br /&gt;query? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:41&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt; &lt;ul&gt;&lt;li&gt;first of all instead of using select * from table1, use select&lt;br /&gt;column1, column2, column3.. from table1&lt;/li&gt;&lt;li&gt;Look for the opportunity to introduce index in the table you are&lt;br /&gt;querying.&lt;/li&gt;&lt;li&gt;use limit keyword if you are looking for any specific number of&lt;br /&gt;rows from the result set.&lt;/li&gt;&lt;/ul&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:42&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How many ways can we get the value of current session id? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:42&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;session_id() returns the session id for the current session.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:43&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we destroy the session, how can we unset the variable of&lt;br /&gt;a session? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:43&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;session_unregister — Unregister a global variable from the current&lt;br /&gt;session&lt;br /&gt;session_unset — Free all session variables&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:44&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we destroy the cookie? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:44&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;Set the cookie in past.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:45&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How many ways we can pass the variable through the navigation&lt;br /&gt;between the pages? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:45&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt; &lt;ul&gt;&lt;li&gt;GET/QueryString&lt;/li&gt;&lt;li&gt;POST&lt;/li&gt;&lt;/ul&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:46&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What is the difference between ereg_replace() and eregi_replace()?&lt;br /&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:46&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;eregi_replace() function is identical to ereg_replace() except that&lt;br /&gt;this ignores case distinction when matching alphabetic&lt;br /&gt;characters.eregi_replace() function is identical to ereg_replace()&lt;br /&gt;except that this ignores case distinction when matching alphabetic&lt;br /&gt;characters.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:47&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What are the different functions in sorting an array? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:47&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;Sort(), arsort(),&lt;br /&gt;asort(), ksort(),&lt;br /&gt;natsort(), natcasesort(),&lt;br /&gt;rsort(), usort(),&lt;br /&gt;array_multisort(), and&lt;br /&gt;uksort().&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:48&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we know the count/number of elements of an array? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:48&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;2 ways&lt;br /&gt;a) sizeof($urarray) This function is an alias of count()&lt;br /&gt;b) count($urarray)&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:49&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What is the PHP predefined variable that tells the What types of&lt;br /&gt;images that PHP supports? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:49&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;Though i am not sure if this is wrong or not, With the exif&lt;br /&gt;extension you are able to work with image meta data.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:50&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can I know that a variable is a number or not using a&lt;br /&gt;JavaScript? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:50&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;bool is_numeric ( mixed var)&lt;br /&gt;Returns TRUE if var is a number or a numeric string, FALSE otherwise.or use isNaN(mixed var)The isNaN() function is used to check if a value is not a number.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:51&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;List out some tools through which we can draw E-R diagrams for&lt;br /&gt;mysql. &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:51&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;Case Studio&lt;br /&gt;Smart Draw&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:52&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can I retrieve values from one database server and store them&lt;br /&gt;in other database server using PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:52&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;we can always fetch from one database and rewrite to another. here&lt;br /&gt;is a nice solution of it.$db1 = mysql_connect("host","user","pwd")&lt;br /&gt;mysql_select_db("db1", $db1);&lt;br /&gt;$res1 = mysql_query("query",$db1);$db2 = mysql_connect("host","user","pwd")&lt;br /&gt;mysql_select_db("db2", $db2);&lt;br /&gt;$res2 = mysql_query("query",$db2);At this point you can only fetch records from you previous ResultSet,&lt;br /&gt;i.e $res1 - But you cannot execute new query in $db1, even if you&lt;br /&gt;supply the link as because the link was overwritten by the new db.so at this point the following script will fail&lt;br /&gt;$res3 = mysql_query("query",$db1); //this will failSo how to solve that? &lt;p&gt;take a look below.&lt;br /&gt;$db1 = mysql_connect("host","user","pwd")&lt;br /&gt;mysql_select_db("db1", $db1);&lt;br /&gt;$res1 = mysql_query("query",$db1);&lt;/p&gt; &lt;p&gt;$db2 = mysql_connect("host","user","pwd", true)&lt;br /&gt;mysql_select_db("db2", $db2);&lt;br /&gt;$res2 = mysql_query("query",$db2);&lt;/p&gt; &lt;p&gt;So mysql_connect has another optional boolean parameter which&lt;br /&gt;indicates whether a link will be created or not. as we connect to the&lt;br /&gt;$db2 with this optional parameter set to 'true', so both link will&lt;br /&gt;remain live.&lt;/p&gt; &lt;p&gt;now the following query will execute successfully.&lt;br /&gt;$res3 = mysql_query("query",$db1);&lt;/p&gt; &lt;p&gt;Thanks goes to Hasan and Hasin for this solution.&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:53&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;List out the predefined classes in PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:53&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;Directory&lt;br /&gt;stdClass&lt;br /&gt;__PHP_Incomplete_Class&lt;br /&gt;exception&lt;br /&gt;php_user_filter&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:54&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can I make a script that can be bi-language (supports&lt;br /&gt;English, German)? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:54&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;You can maintain two separate language file for each of the&lt;br /&gt;language. all the labels are putted in both language files as variables&lt;br /&gt;and assign those variables in the PHP source. on runtime choose the&lt;br /&gt;required language option.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:55&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What are the difference between abstract class and interface? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:55&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;Abstract class: abstract classes are the class where one or more&lt;br /&gt;methods are abstract but not necessarily all method has to be abstract.&lt;br /&gt;Abstract methods are the methods, which are declare in its class but not&lt;br /&gt;define. The definition of those methods must be in its extending class.Interface: Interfaces are one type of class where all the methods are&lt;br /&gt;abstract. That means all the methods only declared but not defined. All&lt;br /&gt;the methods must be define by its implemented class.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:56&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we send mail using JavaScript? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:56&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;JavaScript does not have any networking capabilities as it is&lt;br /&gt;designed to work on client site. As a result we can not send mails using&lt;br /&gt;JavaScript. But we can call the client side mail protocol &lt;b&gt;mailto&lt;/b&gt;&lt;br /&gt;via JavaScript to prompt for an email to send. this requires the client&lt;br /&gt;to approve it.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:57&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we repair a MySQL table? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:57&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;The syntex for repairing a MySQL table is&lt;br /&gt;REPAIR TABLENAME, [TABLENAME, ], [Quick],[Extended]&lt;br /&gt;This command will repair the table specified if the quick is given the&lt;br /&gt;MySQL will do a repair of only the index tree if the extended is given&lt;br /&gt;it will create index row by row&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:58&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What are the advantages of stored procedures, triggers, indexes?&lt;br /&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:58&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;A stored procedure is a set of SQL commands that can be compiled and&lt;br /&gt;stored in the server. Once this has been done, clients don't need to&lt;br /&gt;keep re-issuing the entire query but can refer to the stored procedure.&lt;br /&gt;This provides better overall performance because the query has to be&lt;br /&gt;parsed only once, and less information needs to be sent between the&lt;br /&gt;server and the client. You can also raise the conceptual level by having&lt;br /&gt;libraries of functions in the server. However, stored procedures of&lt;br /&gt;course do increase the load on the database server system, as more of&lt;br /&gt;the work is done on the server side and less on the client (application)&lt;br /&gt;side.Triggers will also be implemented. A trigger is effectively a type of&lt;br /&gt;stored procedure, one that is invoked when a particular event occurs.&lt;br /&gt;For example, you can install a stored procedure that is triggered each&lt;br /&gt;time a record is deleted from a transaction table and that stored&lt;br /&gt;procedure automatically deletes the corresponding customer from a&lt;br /&gt;customer table when all his transactions are deleted.Indexes are used to find rows with specific column values quickly.&lt;br /&gt;Without an index, MySQL must begin with the first row and then read&lt;br /&gt;through the entire table to find the relevant rows. The larger the&lt;br /&gt;table, the more this costs. If the table has an index for the columns in&lt;br /&gt;question, MySQL can quickly determine the position to seek to in the&lt;br /&gt;middle of the data file without having to look at all the data. If a&lt;br /&gt;table has 1,000 rows, this is at least 100 times faster than reading&lt;br /&gt;sequentially. If you need to access most of the rows, it is faster to&lt;br /&gt;read sequentially, because this minimizes disk seeks.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:59&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What is the maximum length of a table name, database name, and&lt;br /&gt;fieldname in MySQL? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:59&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;The following table describes the maximum length for each type of&lt;br /&gt;identifier. &lt;p class="informaltable"&gt; &lt;table border="1"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td&gt;&lt;span class="bold"&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Identifier&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span class="bold"&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Maximum Length&lt;br /&gt;(bytes)&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;Database&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;64&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;Table&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;64&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;Column&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;64&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;Index&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;64&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;Alias&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;255&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;&lt;p&gt;There are some restrictions on the characters that may appear in&lt;br /&gt;identifiers:&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:60&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How many values can the SET function of MySQL take? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:60&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;MySQL set can take zero or more values but at the maximum it can&lt;br /&gt;take 64 values&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:61&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What are the other commands to know the structure of table using&lt;br /&gt;MySQL commands except explain command? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:61&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;describe Table-Name;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:62&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How many tables will create when we create table, what are they?&lt;br /&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:62&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;The '.frm' file stores the table definition.&lt;br /&gt;The data file has a '.MYD' (MYData) extension.&lt;br /&gt;The index file has a '.MYI' (MYIndex) extension,&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:63&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What is the purpose of the following files having extensions 1) .frm&lt;br /&gt;2) .myd 3) .myi? What do these files contain? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:63&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;In MySql, the default table type is MyISAM.&lt;br /&gt;Each MyISAM table is stored on disk in three files. The files have names&lt;br /&gt;that begin with the table name and have an extension to indicate the&lt;br /&gt;file type.&lt;br /&gt;The '.frm' file stores the table definition.&lt;br /&gt;The data file has a '.MYD' (MYData) extension.&lt;br /&gt;The index file has a '.MYI' (MYIndex) extension,&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:64&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What is maximum size of a database in MySQL? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:64&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;If the operating system or filesystem places a limit on the number&lt;br /&gt;of files in a directory, MySQL is bound by that constraint.The efficiency of the operating system in handling large numbers of&lt;br /&gt;files in a directory can place a practical limit on the number of tables&lt;br /&gt;in a database. If the time required to open a file in the directory&lt;br /&gt;increases significantly as the number of files increases, database&lt;br /&gt;performance can be adversely affected.&lt;br /&gt;The amount of available disk space limits the number of tables.&lt;br /&gt;MySQL 3.22 had a 4GB (4 gigabyte) limit on table size. With the MyISAM&lt;br /&gt;storage engine in MySQL 3.23, the maximum table size was increased to&lt;br /&gt;65536 terabytes (2567 – 1 bytes). With this larger allowed table size,&lt;br /&gt;the maximum effective table size for MySQL databases is usually&lt;br /&gt;determined by operating system constraints on file sizes, not by MySQL&lt;br /&gt;internal limits.The InnoDB storage engine maintains InnoDB tables within a tablespace&lt;br /&gt;that can be created from several files. This allows a table to exceed&lt;br /&gt;the maximum individual file size. The tablespace can include raw disk&lt;br /&gt;partitions, which allows extremely large tables. The maximum tablespace&lt;br /&gt;size is 64TB.&lt;br /&gt;The following table lists some examples of operating system file-size&lt;br /&gt;limits. This is only a rough guide and is not intended to be definitive.&lt;br /&gt;For the most up-to-date information, be sure to check the documentation&lt;br /&gt;specific to your operating system.&lt;br /&gt;Operating System File-size LimitLinux 2.2-Intel 32-bit 2GB (LFS: 4GB)&lt;br /&gt;Linux 2.4+ (using ext3 filesystem) 4TB&lt;br /&gt;Solaris 9/10 16TB&lt;br /&gt;NetWare w/NSS filesystem 8TB&lt;br /&gt;Win32 w/ FAT/FAT32 2GB/4GB&lt;br /&gt;Win32 w/ NTFS 2TB (possibly larger)&lt;br /&gt;MacOS X w/ HFS+ 2TB&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:65&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;Give the syntax of Grant and Revoke commands? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:65&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;The generic syntax for grant is as following&lt;br /&gt;&gt; GRANT [rights] on [database/s] TO [username@hostname] IDENTIFIED BY&lt;br /&gt;[password]&lt;br /&gt;now rights can be&lt;br /&gt;a) All privileges&lt;br /&gt;b) combination of create, drop, select, insert, update and delete etc.We can grant rights on all databse by using *.* or some specific&lt;br /&gt;database by database.* or a specific table by database.table_name&lt;br /&gt;username@hotsname can be either username@localhost, username@hostname&lt;br /&gt;and username@%&lt;br /&gt;where hostname is any valid hostname and % represents any name, the *.*&lt;br /&gt;any condition&lt;br /&gt;password is simply the password of userThe generic syntax for revoke is as following&lt;br /&gt;&gt; REVOKE [rights] on [database/s] FROM [username@hostname]&lt;br /&gt;now rights can be as explained above&lt;br /&gt;a) All privileges&lt;br /&gt;b) combination of create, drop, select, insert, update and delete etc.&lt;br /&gt;username@hotsname can be either username@localhost, username@hostname&lt;br /&gt;and username@%&lt;br /&gt;where hostname is any valid hostname and % represents any name, the *.*&lt;br /&gt;any condition&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:66&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;Explain Normalization concept? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:66&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;The normalization process involves getting our data to conform to&lt;br /&gt;three progressive normal forms, and a higher level of normalization&lt;br /&gt;cannot be achieved until the previous levels have been achieved (there&lt;br /&gt;are actually five normal forms, but the last two are mainly academic and&lt;br /&gt;will not be discussed).First Normal FormThe First Normal Form (or 1NF) involves removal of redundant data&lt;br /&gt;from horizontal rows. We want to ensure that there is no duplication of&lt;br /&gt;data in a given row, and that every column stores the least amount of&lt;br /&gt;information possible (making the field atomic).Second Normal FormWhere the First Normal Form deals with redundancy of data across a&lt;br /&gt;horizontal row, Second Normal Form (or 2NF) deals with redundancy of&lt;br /&gt;data in vertical columns. As stated earlier, the normal forms are&lt;br /&gt;progressive, so to achieve Second Normal Form, your tables must already&lt;br /&gt;be in First Normal Form.Third Normal Form &lt;p&gt;I have a confession to make; I do not often use Third Normal Form. In&lt;br /&gt;Third Normal Form we are looking for data in our tables that is not&lt;br /&gt;fully dependant on the primary key, but dependant on another value in&lt;br /&gt;the table&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:67&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we find the number of rows in a table using MySQL? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:67&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;Use this for mysql&lt;br /&gt;&gt;SELECT COUNT(*) FROM table_name;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:68&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we find the number of rows in a result set using PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:68&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;code&gt;$result = mysql_query($sql, $db_link);&lt;br /&gt;$num_rows = mysql_num_rows($result);&lt;br /&gt;echo "$num_rows rows found";&lt;/code&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:69&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How many ways we can we find the current date using MySQL? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:69&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;SELECT CURDATE();&lt;br /&gt;CURRENT_DATE() = CURDATE()&lt;br /&gt;for time use&lt;br /&gt;SELECT CURTIME();&lt;br /&gt;CURRENT_TIME() = CURTIME()&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:70&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What are the advantages and disadvantages of Cascading Style&lt;br /&gt;Sheets? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:70&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;External Style SheetsAdvantagesCan control styles for multiple documents at once. Classes can be&lt;br /&gt;created for use on multiple HTML element types in many documents.&lt;br /&gt;Selector and grouping methods can be used to apply styles under complex&lt;br /&gt;contextsDisadvantagesAn extra download is required to import style information for each&lt;br /&gt;document The rendering of the document may be delayed until the external&lt;br /&gt;style sheet is loaded Becomes slightly unwieldy for small quantities of&lt;br /&gt;style definitionsEmbedded Style Sheets &lt;p&gt;Advantages&lt;/p&gt; &lt;p&gt;Classes can be created for use on multiple tag types in the document.&lt;br /&gt;Selector and grouping methods can be used to apply styles under complex&lt;br /&gt;contexts. No additional downloads necessary to receive style information&lt;/p&gt; &lt;p&gt;Disadvantages&lt;/p&gt; &lt;p&gt;This method can not control styles for multiple documents at once&lt;/p&gt; &lt;p&gt;Inline Styles&lt;/p&gt; &lt;p&gt;Advantages&lt;/p&gt; &lt;p&gt;Useful for small quantities of style definitions. Can override other&lt;br /&gt;style specification methods at the local level so only exceptions need&lt;br /&gt;to be listed in conjunction with other style methods&lt;/p&gt; &lt;p&gt;Disadvantages&lt;/p&gt; &lt;p&gt;Does not distance style information from content (a main goal of&lt;br /&gt;SGML/HTML). Can not control styles for multiple documents at once.&lt;br /&gt;Author can not create or control classes of elements to control multiple&lt;br /&gt;element types within the document. Selector grouping methods can not be&lt;br /&gt;used to create complex element addressing scenarios&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:71&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What type of inheritance that PHP supports? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:71&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;In PHP an extended class is always dependent on a single base class,&lt;br /&gt;that is, multiple inheritance is not supported. Classes are extended&lt;br /&gt;using the keyword 'extends'.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:72&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What is the difference between Primary Key and&lt;br /&gt;Unique key? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:72&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;Primary Key: A column in a table whose values uniquely identify the&lt;br /&gt;rows in the table. A primary key value cannot be NULL. &lt;p&gt;Unique Key: Unique Keys are used to uniquely identify each row in the&lt;br /&gt;table. There can be one and only one row for each unique key value. So&lt;br /&gt;NULL can be a unique key.There can be only one primary key for a table but there can be more&lt;br /&gt;than one unique for a table.&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;&lt;br /&gt;&lt;span style="background-color: rgb(255, 204, 102);"&gt;Q:73&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;b&gt;&lt;span style="background-color: rgb(255, 204, 102);"&gt;The structure of table view buyers is as follows:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/b&gt; &lt;table class="mceVisualAid" style="border: 1px solid ; padding: 1px; border-collapse: collapse;" border="0" cellpadding="3" cellspacing="1" width="450"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td class="mceVisualAid" align="center"&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Field&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" align="center"&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Type&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" align="center"&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Null&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" align="center"&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Key&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" align="center"&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Default&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" align="center"&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Extra&lt;/span&gt;&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid"&gt;&lt;span style="font-size:85%;"&gt;user_pri_id&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;span style="font-size:85%;"&gt;int(15)&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;span style="font-size:85%;"&gt;PRI&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;span style="font-size:85%;"&gt;null&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;span style="font-size:85%;"&gt;auto_increment&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid"&gt;&lt;span style="font-size:85%;"&gt;userid&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;span style="font-size:85%;"&gt;varchar(10)&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;span style="font-size:85%;"&gt;YES&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;span style="font-size:85%;"&gt;null&lt;/span&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;the value of user_pri_id the last row 999 then What will happen in&lt;br /&gt;the following conditions?&lt;/p&gt; &lt;p&gt;&lt;b&gt;Condition1&lt;/b&gt;: Delete all the rows and insert another row then.&lt;br /&gt;What is the starting value for this auto incremented field user_pri_id ,&lt;br /&gt;&lt;b&gt;Condition2&lt;/b&gt;: Delete the last row(having the field value 999) and&lt;br /&gt;insert another row then. What is the value for this auto incremented&lt;br /&gt;field user_pri_id&lt;/p&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:73&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;In both cases let the value for auto increment field be n then next&lt;br /&gt;row will have value n+1 i.e. 1000&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:74&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What are the advantages/disadvantages of MySQL and PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:74&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;Both of them are open source software (so free of cost), support&lt;br /&gt;cross platform. php is faster then ASP and JSP.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:75&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What is the difference between GROUP BY and ORDER BY in Sql? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:75&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;ORDER BY [col1],[col2],…,[coln]; Tels DBMS according to what columns&lt;br /&gt;it should sort the result. If two rows will hawe the same value in col1&lt;br /&gt;it will try to sort them according to col2 and so on.GROUP BY&lt;br /&gt;[col1],[col2],…,[coln]; Tels DBMS to group results with same value of&lt;br /&gt;column col1. You can use COUNT(col1), SUM(col1), AVG(col1) with it, if&lt;br /&gt;you want to count all items in group, sum all values or view average&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:76&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What is the difference between char and varchar data types? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:76&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;Set char to occupy n bytes and it will take n bytes even if u r&lt;br /&gt;storing a value of n-m bytes&lt;br /&gt;Set varchar to occupy n bytes and it will take only the required space&lt;br /&gt;and will not use the n bytes&lt;br /&gt;eg. name char(15) will waste 10 bytes if we store ‘mizan’, if each char&lt;br /&gt;takes a byte&lt;br /&gt;eg. name varchar(15) will just use 5 bytes if we store ‘mizan’, if each&lt;br /&gt;char takes a byte. rest 10 bytes will be free.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:77&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;What is the functionality of md5 function in PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:77&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;Calculate the md5 hash of a string. The hash is a 32-character&lt;br /&gt;hexadecimal number. I use it to generate keys which I use to identify&lt;br /&gt;users etc. If I add random no techniques to it the md5 generated now&lt;br /&gt;will be totally different for the same string I am using.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:78&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can I load data from a text file into a table? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:78&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;you can use LOAD DATA INFILE  file_name; syntax to load data&lt;br /&gt;from a text file. but you have to make sure thata) data is delimited&lt;br /&gt;b) columns and data matched correctly&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:79&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we know the number of days between two given dates using&lt;br /&gt;MySQL? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;b&gt;A:79&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;SELECT DATEDIFF('2007-03-07','2005-01-01');&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" valign="top" width="34"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td class="mceVisualAid"&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" bgcolor="#ffcc66" valign="top" width="34"&gt;&lt;b&gt;Q:80&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" bgcolor="#ffcc66"&gt;&lt;b&gt;How can we know the number of days between two given dates using&lt;br /&gt;PHP? &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="mceVisualAid" align="left" height="24" valign="top" width="34"&gt;&lt;b&gt;A:80&lt;/b&gt;&lt;/td&gt; &lt;td class="mceVisualAid" height="24"&gt;$date1 = date('Y-m-d');&lt;br /&gt;$date2 = '2006-08-15';&lt;br /&gt;$days = (strtotime($date1) - strtotime($date2)) / (60 * 60 * 24);&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3891726027537827996-852657939925424054?l=booleandreams.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://booleandreams.blogspot.com/feeds/852657939925424054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3891726027537827996&amp;postID=852657939925424054' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3891726027537827996/posts/default/852657939925424054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3891726027537827996/posts/default/852657939925424054'/><link rel='alternate' type='text/html' href='http://booleandreams.blogspot.com/2007/08/php-mysql-interview-question-1.html' title='PHP-MySQL Interview Question - 1'/><author><name>PHP Tutor</name><uri>http://www.blogger.com/profile/16269878958363853388</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><thr:total>0</thr:total></entry></feed>
