tag:blogger.com,1999:blog-24327732737604387642024-03-14T00:44:50.663+05:30Naveen(PHP/MySql/Ajax/ExtJs)This blog contains information regarding PHP,HTML, CSS, AJAX, JQUERY AND EXTJS.mickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.comBlogger24125tag:blogger.com,1999:blog-2432773273760438764.post-86052751974934679372010-07-29T13:19:00.001+05:302011-07-06T22:28:29.968+05:30Wordpress 3.0<div dir="ltr" style="text-align: left;" trbidi="on">Wordpress 3.0 looks amazing. i used it and enjoyed very much. It comes with social networking support features.</div>mickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com0tag:blogger.com,1999:blog-2432773273760438764.post-64949327642423298862010-07-28T12:29:00.002+05:302011-07-06T22:29:32.399+05:30Windows7 skype voice problem<div dir="ltr" style="text-align: left;" trbidi="on">I am using windows 7 but there a problem with my skype running on windows7. I didn't get voice and send my voice on skype voice chat. If anybody have solutions please reply to me. Thanks in advance.</div>mickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com0tag:blogger.com,1999:blog-2432773273760438764.post-21611614547020496292010-07-12T16:19:00.001+05:302010-07-12T16:25:37.364+05:30How i can open a tab from a grid every tab calling dynamic functionHow i can open a tab from a grid every tab call dynamic function for items of tab [solved].<br /><br /><span style="font-weight:bold;"><br />Ext.QuickTips.init();<br />Ext.override(Desktop.ReportsWindow, {<br /> createProxy: {},<br /> createWindow: function () {<br /><br /> var desktop = this.app.getDesktop();<br /> var win = desktop.getWindow(this.moduleId);<br /> var app = this.app;<br /> var url = this.app.connection;<br /> var moduleId = this.moduleId;<br /><br /> var myData = [<br /> ['Diagnosis registry', 'Search patients that have a particular diagnosis or ICD9 code.', 'diagnosis'],<br /> ['Medication report', 'Search patients that have been prescribed a particular medicine.', 'medication']<br /> ];<br /><br /> var store = new Ext.data.ArrayStore({<br /> fields: [{<br /> name: 'title'<br /> },<br /> {<br /> name: 'description'<br /> },<br /> {<br /> name: 'report_for'<br /> }]<br /> });<br /><br /> store.loadData(myData);<br /><br /><br /><br /> if (!win) {<br /><br /> var winWidth = desktop.getWinWidth() / 1.1;<br /> var winHeight = desktop.getWinHeight() / 1.2;<br /> win = desktop.createWindow({<br /> id: moduleId,<br /> title: 'Reports',<br /> width: winWidth,<br /> height: winHeight,<br /> maximized: true,<br /> iconCls: 'reports-icon-cls',<br /> layout: 'fit',<br /> items: [{<br /> xtype: 'tabpanel',<br /> activeItem: 0,<br /> id: 'reportsTabPanel',<br /> items: [{<br /> title: 'Reports',<br /> items: [{<br /> xtype: 'grid',<br /> id: 'allReportsGrid',<br /> columnLines: true,<br /> autoHeight: true,<br /> stripeRows: true,<br /> tbar: {<br /> xtype: 'toolbar',<br /> items: ['->',<br /> {<br /> text: 'Run Report',<br /> disabled: true,<br /> id: 'runReportBtn',<br /> handler: this.addNewtab,<br /> scope: this,<br /> }, ' ']<br /> },<br /> viewConfig: {<br /> forceFit: true,<br /> },<br /> selModel: new Ext.grid.RowSelectionModel({<br /> listeners: {<br /> rowselect: function (sel, row, rec) {<br /> Ext.getCmp('runReportBtn').enable();<br /> },<br /> rowdeselect: function (sel, row, rec) {<br /> Ext.getCmp('runReportBtn').disable();<br /> }<br /> }<br /> }),<br /> store: store,<br /><br /> columns: [{<br /> header: 'Title',<br /> dataIndex: 'title',<br /> width: 100<br /> },<br /> {<br /> header: 'Description',<br /> dataIndex: 'description',<br /> width: 200<br /> }, ],<br /> listeners: {<br /> rowdblclick: this.addNewtab,<br /> scope: this<br /> },<br /> }]<br /> }]<br /> }]<br /> })<br /> }<br /> win.show();<br /> },<br /><br /> addNewtab: function () {<br /><br /> var url = this.app.connection;<br /> var moduleId = this.moduleId;<br /><br /> var tabpanel = Ext.getCmp('reportsTabPanel');<br /> var rec = Ext.getCmp('allReportsGrid').getSelectionModel().getSelected();<br /> var title = rec.get('title').replace(/^\s+/, '').replace(/\s+$/, '');<br /> var tabId = title.toLowerCase();<br /> var tabId = tabId.replace(/ /g, '_');<br /><br /><br /> // varaible getting the value which function to call<br /> var reportTab = rec.get('report_for');<br /><br /> if (Ext.getCmp(tabId)) {<br /> tabpanel.setActiveTab(tabId);<br /> return;<br /> }<br /><br /> var tabs = Ext.getCmp('reportsTabPanel').add({<br /> title: title,<br /> id: tabId,<br /> layout: 'fit',<br /> closable: true,<br /><br /> items: this[reportTab](),<br /> //reportTab, //calling the function according to selected record<br /> scope: this,<br /><br /> });<br /> tabpanel.setActiveTab(tabs);<br /> },<br /><br /><br /> diagnosis: function () {<br /> var url = this.app.connection;<br /> var moduleId = this.moduleId;<br /> var report_item = [{<br /> xtype: 'panel',<br /> layout: 'border',<br /> items: [{<br /> xtype: 'form',<br /> region: 'north',<br /> autoHeight: true,<br /> frame: true,<br /> bodyStyle: 'padding : 10px;',<br /> items: [{<br /> xtype: 'fieldset',<br /> border: false,<br /> width: 280,<br /> style: 'padding:0px;margin:0px; float : left',<br /> labelWidth: 55,<br /> items: [{<br /> xtype: 'combo',<br /> style: 'float:left',<br /> fieldLabel: 'Providers',<br /> }]<br /> },<br /> {<br /> xtype: 'button',<br /> text: 'Advance Search',<br /> style: 'float : left',<br /> handler: function () {<br /> //Ext.getCmp('check').show();<br /> }<br /> }]<br /> },<br /> {<br /> xtype: 'grid',<br /> region: 'center',<br /> id: 'center_grid',<br /> viewConfig: {<br /> forceFit: true,<br /> },<br /> store: new Ext.data.Store({}),<br /> columns: [{<br /> header: 'Patient Name',<br /> dataIndex: ''<br /> },<br /> {<br /> header: 'IDC9 Code',<br /> dataIndex: ''<br /> },<br /> {<br /> header: 'Diagnosis',<br /> dataIndex: ''<br /> },<br /> {<br /> header: 'Dx Date',<br /> dataIndex: ''<br /> },<br /> {<br /> header: 'Last Seen',<br /> dataIndex: ''<br /> },<br /> {<br /> header: 'Provider',<br /> dataIndex: ''<br /> }, ]<br /> }]<br /> }];<br /><br /> return report_item;<br /><br /> },<br /> medication: function () {<br /> var url = this.app.connection;<br /> var moduleId = this.moduleId;<br /> var medication_tab = [{<br /> xtype: 'panel',<br /> layout: 'border',<br /> items: [{<br /> xtype: 'form',<br /> region: 'north',<br /> autoHeight: true,<br /> frame: true,<br /> bodyStyle: 'padding : 10px;',<br /> items: [{<br /> xtype: 'fieldset',<br /> border: false,<br /> width: 280,<br /> style: 'padding:0px;margin:0px; float : left',<br /> labelWidth: 55,<br /> items: [{<br /> xtype: 'combo',<br /> style: 'float:left',<br /> fieldLabel: 'Providers',<br /> }]<br /> },<br /> {<br /> xtype: 'button',<br /> text: 'Advance Search',<br /> style: 'float : left',<br /> handler: function () {<br /><br /> }<br /> }]<br /> },<br /> {<br /> xtype: 'grid',<br /> region: 'center',<br /> id: 'center_grid',<br /> viewConfig: {<br /> forceFit: true,<br /> },<br /> store: new Ext.data.Store({}),<br /> columns: [{<br /> header: 'Patient Name',<br /> dataIndex: ''<br /> },<br /> {<br /> header: 'Medication',<br /> dataIndex: ''<br /> },<br /> {<br /> header: 'Strength',<br /> dataIndex: ''<br /> },<br /> {<br /> header: 'Rx Start Date',<br /> dataIndex: ''<br /> },<br /> {<br /> header: 'Rx Stop Date',<br /> dataIndex: ''<br /> },<br /> {<br /> header: 'Last Seen',<br /> dataIndex: ''<br /> },<br /> {<br /> header: 'Provider',<br /> dataIndex: ''<br /> }, ]<br /> }]<br /> }];<br /><br /> return medication_tab;<br /> }<br />})</span><br /><br />This code calling dynamic functions for the items of tab.<br /><span style="font-weight:bold;">items: this[reportTab]()</span><br /><br /><br />Thanks!<br />I Hope it will help<br />Adminmickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com0tag:blogger.com,1999:blog-2432773273760438764.post-25739622505243228472010-07-07T10:17:00.006+05:302010-07-07T10:23:11.631+05:30http://www.knowledgepedia.orgHi Friends,<br />I have launched a forum website for web masters for sharing and getting their knowledge. There are many topics like extjs, cakephp, php, joomla etc. for discussion.<br />You can check it here: <a href="http://www.knowledgepedia.org/" target="_blank">http://www.knowledgepedia.org</a><br /><br />Thanks!<br />Nmickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com0tag:blogger.com,1999:blog-2432773273760438764.post-40839980482950691912010-06-04T12:24:00.006+05:302011-07-06T22:31:52.811+05:30Validate space in Java Script<div dir="ltr" style="text-align: left;" trbidi="on"><br />
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">function trim() {</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">ogg =document.getElementById('testid').value;</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">ogg1 = /\S+/.test(ogg);</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">//return /\S+/.test(ogg);</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">if(ogg1==" "){alert('blank');}</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">else{alert(ogg1);}</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">}</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">end script</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">input type="text" onblur="trim();" id="testid"</div></div>mickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com0tag:blogger.com,1999:blog-2432773273760438764.post-41871559912111080752010-05-18T17:50:00.001+05:302010-05-18T17:52:01.080+05:30EXTJS Hide Tab PanelsThis is for hide the tab<br />Ext.getCmp(tabpanel_id).hideTabStripItem(tabitem_id);<br /><br />This is for show the tab again<br />Ext.getCmp(tabpanel_id).unhideTabStripItem(tabitem_id);<br /><br />Thanks!mickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com1tag:blogger.com,1999:blog-2432773273760438764.post-7362489442097657132010-05-13T12:56:00.000+05:302010-05-13T12:57:26.296+05:30Prime Number Programfunction IsPrime($number) <br />{<br /> if ($number < 2) { /* We don't want zero or one showing up as prime */<br /> return FALSE;<br /> }<br /> for ($i=2; $i<=($number / 2); $i++) {<br /> if($number % $i == 0) { /* Modulus operator, very useful */<br /> return FALSE;<br /> }<br /> }<br /> return TRUE;<br />}<br /><br />for($i = 0; $i < 100; $i++)<br />{<br /> echo $i." is a prime number? ".IsPrime($i)."<br />";<br />}mickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com0tag:blogger.com,1999:blog-2432773273760438764.post-23130559181314312222010-05-13T09:48:00.002+05:302010-05-13T09:50:10.219+05:30Mysql1 Stored Procedure<br />2 Cursor<br />3 Trigger<br />4 What is indexing<br />5 Difference between MyIsam and InnoDB.<br />6 Delete Duplicate entries and keep only one from the tablemickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com0tag:blogger.com,1999:blog-2432773273760438764.post-1539622889270182452010-05-11T10:35:00.003+05:302010-05-11T10:45:53.663+05:30Joomla 1.5 Dreamweaver extensionDownload Here:<br /><br /><a href="http://www.joomlaaa.com/Joomla-Articles/Joomla-templatebuilder/Joomla-1.5-Dreamweaver-extension.html">Joomla Extension</a><br /><br /><br />and For more Info go to my Web site <a href="http://prosolv.0fees.net/viewforum.php?f=3">How to Use...</a>mickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com0tag:blogger.com,1999:blog-2432773273760438764.post-47816813678794319882010-05-07T18:19:00.000+05:302010-05-07T18:20:37.708+05:30How to increase your session time out PHP<?php session_start();
<br />
<br />/*********************** Increase the session time out *****************/
<br /> $values = $_SESSION;
<br />
<br /> // keep session config
<br /> $trans = ini_get( 'session.use_trans_sid' );
<br /> if( $trans ) {
<br /> ini_set( 'session.use_trans_sid', 0 );
<br /> }
<br /> $cookie = session_get_cookie_params();
<br />
<br /> // create new session id
<br /> $id = 0;
<br /> while (strlen($id) < 32) {
<br /> $id .= mt_rand(0, mt_getrandmax());
<br /> }
<br />
<br /> $id = md5( uniqid($id, true));
<br />
<br /> // kill session
<br /> session_destroy();
<br />
<br /> $cookie['lifetime'] = 7*60; // minutes * 60
<br />
<br /> // restore config
<br /> ini_set( 'session.use_trans_sid', $trans );
<br /> session_set_cookie_params( $cookie['lifetime'], $cookie['path'], $cookie['domain'], $cookie['secure'] );
<br />
<br /> session_cache_expire($cookie['lifetime'] / 60);
<br /> ini_set('session.gc_maxlifetime', $cookie['lifetime']);
<br /> // restart session with new id
<br /> session_id( $id );
<br /> session_start();
<br /> $_SESSION = $values;
<br />
<br />/*********************************** End *******************************/
<br />?>mickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com0tag:blogger.com,1999:blog-2432773273760438764.post-89106610058975033962010-04-19T17:22:00.001+05:302010-04-19T17:22:54.831+05:30Joomla solutions extension for dreamweaverhttp://www.joomlaspots.com/Addons/joomla-dreamweaver-extension.phpmickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com0tag:blogger.com,1999:blog-2432773273760438764.post-13215935881423749962010-04-14T15:24:00.001+05:302010-04-14T15:26:24.641+05:30scrapbook<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="ScrapHDPlayer" width="310" height="220" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"><param name="movie" value="http://media-scraphd.s3.amazonaws.com/ScrapHDPlayer.swf?scrapId=2163&userId=126&height=420&serviceURL=http://www.scraphd.com/messagebroker/amf&partnerLogo=http://media-scraphd.s3.amazonaws.com/partners/" flashvars="scrapId=2163&userId=126&height=420&serviceURL=http://www.scraphd.com/messagebroker/amf&partnerLogo=http://media-scraphd.s3.amazonaws.com/partners/" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="allowScriptAccess" value="sameDomain" /><param name="flashVars" value="scrapId=2163&userId=100&serviceURL=http://www.scraphd.com/messagebroker/amf"><embed src="http://media-scraphd.s3.amazonaws.com/ScrapHDPlayer.swf?scrapId=2163&userId=126&height=420&serviceURL=http://www.scraphd.com/messagebroker/amf&partnerLogo=http://media-scraphd.s3.amazonaws.com/partners/" width="510" height="420" name="ScrapHDPlayer" align="middle" play="true" flashvars="scrapId=2163&userId=126&height=420&serviceURL=http://www.scraphd.com/messagebroker/amf&partnerLogo=http://media-scraphd.s3.amazonaws.com/partners/" loop="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"></embed></object>mickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com0tag:blogger.com,1999:blog-2432773273760438764.post-62898601559812835162010-04-12T18:09:00.000+05:302010-04-12T18:13:22.356+05:30How to use DATE_FORMAT() in mysql$query = "SELECT DATE_FORMAT(DATETIME,'%m/%d/%Y') as NewDate,id FROM TableName ORDER BY DATETIME DESC";<br /><br />result:<br />month(numeric)/day(numeric)/year(numeric)..<br /><br />cheers :)mickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com0tag:blogger.com,1999:blog-2432773273760438764.post-59584052019061616662010-04-12T10:52:00.000+05:302010-04-12T10:54:24.133+05:30How to decode json response in ExtJs//when json response is in this format {"success":true,"data":{"id":11}}<br />Ext.Ajax.request({<br /> url:'connect.php',<br /> params:{moduleId:moduleId, status:'insert',activity:'save',action:'doAction'},<br /> success:function(res){<br /> var response = Ext.util.JSON.decode(res.responseText); <br /> alert(response.data.id);<br /> }<br /> });mickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com0tag:blogger.com,1999:blog-2432773273760438764.post-56325984770488845302010-04-08T15:28:00.000+05:302010-04-08T16:39:04.178+05:30paging in PHP<?php <br /><br /> $count_rec=400; //give here the total number of records<br /> if($count_rec>0) { <br /> $total_pages=ceil($count_rec/20);<br /> $page=$_REQUEST['page'];<br /> $start=($page-1)*20+1;<br /> $end=$start+19;<br /> $x=$start;<br /> <br /> //foreach ($photosetList[photoset] as $setList) {<br /> //$sizes = $f->photos_getSizes($setList[primary]);<br /> <br /> if($end%$x<=19) {<br /> echo "<a href='#'></a>";<br /> }<br /> //}<br /> }<br /> echo "<br>";<br /> <br /> if($end>$count_rec) <br /> {<br /> $end=$count_rec;<br /> }<br /> <br /> if($page==1)<br /> { <br /> echo "<<";<br /> }else<br /> {<br /> $back=$page-1;<br /> ?><br /> <br /> <a class="anchorlink" href="pagingPhp.php?page=<?php echo $back;?>"><<<</a><br /> <br /> <?php } ?><br /> <br /> <?php <br /> $val=ceil($count_rec/20); <br /> echo "Page :- ".$_REQUEST['page']; <br /> if($page==$val)<br /> {<br /> echo " >>";<br /> }else<br /> { <br /> $next=$page+1; <br /> ?><br /> <a class="anchorlink" href="pagingPhp.php?page=<?php echo $next;?>">>></a><br /> <br /> <?php } ?>mickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com1tag:blogger.com,1999:blog-2432773273760438764.post-88955288836794464032010-04-03T13:54:00.001+05:302010-04-03T13:54:28.916+05:30ExtJs dataview refresh problem[code]Ext.getCmp(dataview id).getStore().load({params:{}});<br />or<br />Ext.getCmp(dataview id).getStore().reload();<br /><br />By using this code your dataview automatically be refreshed.[/code]<br />[b]NOTE: The response only come in the pure json format[/b]<br /><br />If you will use this in PHP for fetching the data for <br />dataview you must declare $json_data['templateItems'][]= $row; <br />in case of no result found. Otherwise your data view not working correctly.<br />[code]<br />$result= mysql_query($query); <br />$json_data['templateItems'] = array();<br />while($row= mysql_fetch_assoc($result)){ <br />$json_data['templateItems'][]= $row; <br />}<br />echo json_encode($json_data);exit;[/code]<br /><br />[b]Data view code[/b]<br />[code]new Ext.DataView({<br />store: new Ext.data.JsonStore({<br />url: 'connect.php',<br />baseParams: {moduleId:moduleId,action:'doAction',activity:'getTemplateCats'},<br />autoLoad:false,<br />root: 'templatecats',<br />fields: ['templatecat_name','id']<br />}),<br />tpl: new Ext.XTemplate(<br />'<tpl for=".">', <br />'<div class="thumb-wrap">{templatecat_name}</div>', <br />'</tpl>' <br />),<br />listeners : { <br />click : function(dataView,index,node,e) { <br />var record = dataView.getRecord(node);<br />var cat_name =record.get("templatecat_name");<br />var cat_id =record.get('id');<br /><br />Ext.getCmp('cat_id_temp_s').setValue(cat_id);<br />Ext.getCmp('newCardS').getLayout().setActiveItem(1);<br />Ext.getCmp('s-templates-items').getStore().load(<br />{params:{moduleId:moduleId,action:'doAction',<br />cat_id:cat_id,templatelocation:'subjective',activity:'getTemplates'}});<br />} <br />},<br />id:'s-templates',<br />autoHeight:true,<br />multiSelect: true,<br />overClass:'x-view-over',<br />itemSelector:'div.thumb-wrap',<br />emptyText: 'No templates to display'<br />})[/code]mickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com0tag:blogger.com,1999:blog-2432773273760438764.post-86360597894783638372010-03-27T11:58:00.001+05:302010-03-27T11:58:56.956+05:30New Interview Questions1. how to get the ip address.<br />2. diff. b/w echo,print, print_r.<br />3. ftp php (how we connect to ftp)(ans: ftp_connect() "Opens an FTP connection")<br />4. paypal<br />5. php oops<br />6. pconnect, connect<br />7. Explain join queries<br />8. Example of Join Query(join,left,right)<br />9. step of joomla template<br />10. function overriding and overloading.<br />11. array merge ans: $ab=array_merge(array('a','b'),array('c','d'));<br />12. find max salary and min salary using join.<br /><br /><br />mysql_pconnect() acts very much like mysql_connect() with two major differences.<br /><br />First, when connecting, the function would first try to find a (persistent) link that's already open with the same host, username and password. If one is found, an identifier for it will be returned instead of opening a new connection.<br /><br />Second, the connection to the SQL server will not be closed when the execution of the script ends. Instead, the link will remain open for future use (mysql_close() will not close links established by mysql_pconnect()).<br /><br />This type of link is therefore called 'persistent'.mickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com0tag:blogger.com,1999:blog-2432773273760438764.post-30684169707997200552010-03-27T11:52:00.001+05:302010-03-27T11:52:44.509+05:30Uploading filesCREATE TABLE my_files (<br /> id INT(11) NOT NULL AUTO_INCREMENT,<br /> name VARCHAR(75) NOT NULL,<br /> type VARCHAR(255) NOT NULL,<br /> size INT(11) NOT NULL,<br /> data MEDIUMBLOB NOT NULL,<br /> created DATETIME,<br /> modified DATETIME,<br /> PRIMARY KEY (id)<br />);<br /><br /><br />// app/models/my_file.php<br />class MyFile extends AppModel {<br /> var $name = 'MyFile';<br />}<br /><br /><br />// app/views/my_files/add.ctp (Cake 1.2)<br /><?php<br /> echo $form->create('MyFile', array('action' => 'add', 'type' => 'file'));<br /> echo $form->file('File');<br /> echo $form->submit('Upload');<br /> echo $form->end();<br />?><br /><br />// app/views/my_files/add.thtml (Cake 1.1)<br /><form action="/my_files/add" enctype="multipart/form-data" method="post"><br /> <?php echo $html->file('File'); ?><br /> <?php echo $html->submit('Upload'); ?><br /></form><br /><br /><br />// app/controllers/my_files_controller.php (Cake 1.2)<br />class MyFilesController extends AppController {<br /> function add() {<br /> if (!empty($this->data) &&<br /> is_uploaded_file($this->data['MyFile']['File']['tmp_name'])) {<br /> $fileData = fread(fopen($this->data['MyFile']['File']['tmp_name'], "r"),<br /> $this->data['MyFile']['File']['size']);<br /><br /> $this->data['MyFile']['name'] = $this->data['MyFile']['File']['name'];<br /> $this->data['MyFile']['type'] = $this->data['MyFile']['File']['type'];<br /> $this->data['MyFile']['size'] = $this->data['MyFile']['File']['size'];<br /> $this->data['MyFile']['data'] = $fileData;<br /><br /> $this->MyFile->save($this->data);<br /><br /> $this->redirect('somecontroller/someaction');<br /> }<br /> }<br />}<br /><br />// app/controllers/my_files_controller.php (Cake 1.1)<br />class MyFilesController extends AppController {<br /> function add() {<br /> if (!empty($this->params['form']) &&<br /> is_uploaded_file($this->params['form']['File']['tmp_name'])) {<br /> $fileData = fread(fopen($this->params['form']['File']['tmp_name'], "r"),<br /> $this->params['form']['File']['size']);<br /> $this->params['form']['File']['data'] = $fileData;<br /><br /> $this->MyFile->save($this->params['form']['File']);<br /><br /> $this->redirect('somecontroller/someaction');<br /> }<br /> }<br />}<br /><br /><br /><br />and for download that file:<br /><br />function download($id) {<br /> Configure::write('debug', 0);<br /> $file = $this->MyFile->findById($id);<br /><br /> header('Content-type: ' . $file['MyFile']['type']);<br /> header('Content-length: ' . $file['MyFile']['size']);<br /> header('Content-Disposition: attachment; filename="'.$file['MyFile']['name'].'"');<br /> echo $file['MyFile']['data'];<br /><br /> exit();<br />}mickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com0tag:blogger.com,1999:blog-2432773273760438764.post-45159004513887320882010-03-27T11:47:00.000+05:302010-03-27T11:50:52.011+05:30how to redirect automatically Using meta tag"start head tag here"<br />less than META HTTP-EQUIV="Refresh" CONTENT="10;URL=http://www.example.org/articles.htm"><br />"end head tag here"<br /><br /><br />parvinder kumar is online.<br />parvinder: <SCRIPT LANGUAGE="JavaScript"><!--<br />function redirect () {<br />setTimeout("go_now()",10000);<br />}<br />//--><br /></SCRIPT><br /><SCRIPT LANGUAGE="JavaScript"><!--<br />function go_now () {<br />window.location.href = "http://www.example.org/articles.htm";<br />}<br />//--><br /></SCRIPT><br />BODY onLoad="redirect()">mickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com0tag:blogger.com,1999:blog-2432773273760438764.post-75648557835165127692010-03-27T11:46:00.000+05:302010-03-27T11:47:11.961+05:30How to bake a cake applicationE:\cake_test\app>..\cake\console\cake bakemickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com0tag:blogger.com,1999:blog-2432773273760438764.post-86312117316550760492009-10-01T15:42:00.000+05:302009-12-09T19:16:06.376+05:30INTERVIEW QUESTIONS PART 3<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_F-OEVqx5WTg/Sx-qDNHccyI/AAAAAAAAADE/lS8yoziG4lQ/s1600-h/1-480708-3944-t.jpg"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 128px; height: 171px;" src="http://2.bp.blogspot.com/_F-OEVqx5WTg/Sx-qDNHccyI/AAAAAAAAADE/lS8yoziG4lQ/s320/1-480708-3944-t.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5413232249159840546" /></a><br />PHP interview questions, Part 2<br />Web dev interview questions<br />1. How can we repair a MySQL table? <br />2. What are the advantages of stored procedures, triggers, indexes? <br />3. What is the maximum length of a table name, database name, and fieldname in MySQL? <br />4. How many values can the SET function of MySQL take? <br />5. What are the other commands to know the structure of table using MySQL commands except explain command? <br />6. How many tables will create when we create table, what are they? <br />7. What is the purpose of the following files having extensions 1) .frm 2) .myd 3) .myi? What do these files contain? <br />8. What is maximum size of a database in MySQL? <br />9. Give the syntax of Grant and Revoke commands? <br />10. Explain Normalization concept? <br />11. How can we find the number of rows in a table using MySQL? <br />12. How can we find the number of rows in a result set using PHP? <br />13. How many ways we can we find the current date using MySQL? <br />14. What are the advantages and disadvantages of Cascading Style Sheets? <br />15. What type of inheritance that PHP supports? <br />16. How can increase the performance of MySQL select query? <br />17. The structure of table view buyers is as follows: <br />18. +----------------+-------------+------+-----+---------+----------------+<br />19. | Field | Type | Null | Key | Default | Extra |<br />20. +----------------+-------------+------+-----+---------+----------------+<br />21. | user_pri_id | int(15) | | PRI | NULL | auto_increment |<br />22. | userid | varchar(10) | YES | | NULL | |<br />23. +----------------+-------------+------+-----+---------+----------------+<br />the value of user_pri_id the last row 2345 then What will happen in the following conditions?<br />Condition1: Delete all the rows and insert another row then. What is the starting value for this auto incremented field user_pri_id ,<br />Condition2: Delete the last row(having the field value 2345) and insert another row then. What is the value for this auto incremented field user_pri_id <br />24. What are the advantages/disadvantages of MySQL and PHP? <br />25. What is the difference between GROUP BY and ORDER BY in Sql? <br />26. What is the difference between char and varchar data types? <br />27. What is the functionality of md5 function in PHP? <br />28. How can I load data from a text file into a table? <br />29. How can we know the number of days between two given dates using MySQL? <br />30. How can we know the number of days between two given dates using PHP? <br />31. How can we change the name of a column of a table? <br />32. How can we change the name and data type of a column of a table? <br />33. What are the differences between drop a table and truncate a table? <br />34. When you want to show some part of a text displayed on an HTML page in red font color, what different possibilities are there to do this? What are the advantages/disadvantages of these methods? <br />35. When viewing an HTML page in a Browser, the Browser often keeps this page in its cache. What can be possible advantages/disadvantages of page caching? How can you prevent caching of a certain page (please give several alternate solutions)? <br />36. What are the different methods of passing data or information between two calls of a web page? What are the advantages/disadvantages of these methods? <br />37. An Apache web server is running on a Linux system. Suddenly, the web server delivers the pages very slow. How could you find out possible reasons for that (when using system commands, please specify their names)? <br />38. What are the different ways to login to a remote server? Explain the means, advantages and disadvantages? <br />39. Please give a regular expression (preferably Perl/PREG style), which can be used to identify the URL from within a HTML link tag. Example: The regular expression should match the tag <A HREF=”http://www.yoursite.com/”></A> and give the URL (”http://www.yoursite.com /”) as a return result. Tags should also be matched if they contain other attributes than the HREF attribute. <br />40. A select query over a large table runs very slow because of the growing number of entries in that table. What different measures could be taken to improve speed? <br />41. A company wants to store their invoices in a database. They already have their customers and articles in that database. Both customer and article are each identified by an unique integer value. Please create the SQL statements for creating the necessary table(s) for storing the invoices in a MySQL database. An invoice should hold information like invoice number, customer, date, article(s) and quantity etc. <br />42. For the database from the previous question, please give an SQL query which returns the invoice number of all invoices which contain the article with the number “1234″. The query should be able to run under a MySQL 4.0 database. <br />43. How would you backup and restore a big MySQL database? What are the advantages of the approach which you have taken over the others? <br />44. Create a PHP web script with the following attributes: on start, three HTML form elements are shown: an string input field, a checkbox field, a dropdown/pull down list with 5 elements and a submit button. On submission, the form should be redisplayed (while remaining all options/inputs as the user has selected/entered them). Additionally, the selections/inputs of the user should be displayed in text. Please solve this without the use of any external libraries. <br />45. What is MIME? <br />46. What is PEAR in PHP? <br />47. How can I use the COM components in PHP? <br />48. How can I load the DLLs dynamically? <br />49. How many ways we can give the output to a browser? <br />50. How can we know that a session is started or not? <br />51. What is the default session time in PHP and how can I change it? <br />52. What changes I have to done in PHP.ini file for file uploading? <br />53. What are the differences between MySQL_fetch_array(), MySQL_fetch_object(), MySQL_fetch_row()? <br />54. How can I set a cron and how can i execute it in Unix, Linux, and windows? <br />55. Steps for the payment gateway processing? <br />56. How many ways I can register the variables into session? <br />57. Explain different types of errors in PHP (i.e. arguments in errorreporting function)? <br />58. How many ways I can redirect a PHP page? <br />59. List out different arguments in PHP header function? <br />60. What type of headers have to add in the mail function in which file a attached? <br />61. What is the difference between <br />62. What are the differences between PHP3 and PHP4 versions? <br />63. What are the differences between include() and include_once() functions? <br />64. Describe the importance of DABA BASE ABSTRACTION LAYERS in PHP and database connection? <br />65. Explain MySQL optimization? <br />66. What is the difference between using copy() and move() function in PHP file uploading? <br />67. What is the difference between Reply-to and Return-path in the headers of a mail function? <br />68. Explain about Type Juggling in PHP? <br />69. How can I get the only name of the current executing file? <br />70. How can I embed a java programme in PHP file and what changes have to be done in PHP.ini file? <br />71. How can I find what type of images that the PHP version supports? <br />72. The table tbl_sites contains the following data: <br />73. -----------------------------------------------------<br />74. Userid sitename country<br />75. ------------------------------------------------------<br />76. 1 sureshbabu indian<br />77. 2 PHPprogrammer andhra<br />78. 3 PHP.net usa<br />79. 4 PHPtalk.com germany<br />80. 5 MySQL.com usa<br />81. 6 sureshbabu canada<br />82. 7 PHPbuddy.com pakistan<br />83. 8. PHPtalk.com austria<br />84. 9. PHPfreaks.com sourthafrica<br />85. 10. PHPsupport.net russia<br />86. 11. sureshbabu australia<br />87. 12. sureshbabu nepal<br />88. 13. PHPtalk.com italy<br />Write a select query that will displayed the duplicated site name and how many times it is duplicated? … <br />Make sure you read Part 1 of PHP interview questions.<br /> <br />41 Comments so far » <br />1. Shatabdi said,<br />1. How can we repair a MySQL table?<br />The syntex for repairing a mysql table is<br />REPAIR TABLENAME, [TABLENAME, ], [Quick],[Extended]<br />This command will repair the table specified<br />if the quick is given the mysql will do a repair of only the index tree if the extended is given it will create index row by row<br />2. Shatabdi said,<br />3. maximum lenghth of mnames of database, table, columns<br />database- 64<br />table -64<br />columns-64<br />alias-255<br />3. Shatabdi said,<br />4.How many values can the SET function of MySQL take?<br />Mysql set can take zero or more values but at the maximum it can take 64 values<br />4. Kumar said,<br />What are the other commands to know the structure of table using MySQL commands except explain command?<br />describe table_name;<br />5. Kumar said,<br />How can we find the number of rows in a table using MySQL?<br />How can we find the number of rows in a result set using PHP? <br />Use this for mysql<br />>SELECT COUNT(*) FROM table_name;<br />but if u r particular about no of rows with some special result<br />do this<br />>SELECT [colms],COUNT(*) FROM table_name [where u put conditions];<br />and for PHP it cant be more simple<br />$result = mysql_query($any_valid_sql, $database_link);<br />$num_rows = mysql_num_rows($result);<br />echo “$num_rows rows found”;<br />6. Kumar said,<br />How many ways we can we find the current date using MySQL?<br />SELECT CURDATE();<br />CURRENT_DATE() = CURDATE()<br />for time use<br />SELECT CURTIME();<br />CURRENT_TIME() = CURTIME()<br />7. Kumar said,<br />Give the syntax of Grant and Revoke commands?<br />The generic syntax for grant is as following<br />> GRANT [rights] on [database/s] TO [username@hostname] IDENTIFIED BY [password]<br />now rights can be<br />a) All privilages<br />b) combination of create, drop, select, insert, update and delete etc.<br />we can grant rights on all databse by usingh *.* or some specific database by database.* or a specific table by database.table_name<br />username@hotsname can be either username@localhost, username@hostname and username@%<br />where hostname is any valid hostname and % represents any name, the *.* any condition<br />password is simply the password of user<br />The generic syntax for revoke is as following<br />> REVOKE [rights] on [database/s] FROM [username@hostname]<br />now rights can be as explained above<br />a) All privilages<br />b) combination of create, drop, select, insert, update and delete etc.<br />username@hotsname can be either username@localhost, username@hostname and username@%<br />where hostname is any valid hostname and % represents any name, the *.* any condition<br />8. Kumar said,<br />The structure of table view buyers is as follows:<br />+—————-+————-+——+—–+———+—————-+<br />| Field | Type | Null | Key | Default | Extra |<br />+—————-+————-+——+—–+———+—————-+<br />| user_pri_id | int(15) | | PRI | NULL | auto_increment |<br />| userid | varchar(10) | YES | | NULL | |<br />+—————-+————-+——+—–+———+—————-+<br />the value of user_pri_id the last row 2345 then What will happen in the following conditions?<br />Condition1: Delete all the rows and insert another row then. What is the starting value for this auto incremented field user_pri_id ,<br />Condition2: Delete the last row(having the field value 2345) and insert another row then. What is the value for this auto incremented field user_pri_id <br />In botth cases let the value for auto increment field be n then next row will have value n+1 i.e. 2346<br />9. Kumar said,<br />What is the difference between char and varchar data types?<br />Set char to occupy n bytes and it will take n bytes even if u r storing avalue of n-m butes<br />Set varchar to occupy n bytes and it will take only the required space and will not use the n bytes<br />eg. name char(10) will waste 5 bytes if we store ‘kumar’, if each char takes a byte<br />eg. name varchar(10) will just use 5 bytes if we store ‘kumar’, if each char takes a byte. rest 5 bytes will be free.<br />10. Kumar said,<br />What is the functionality of md5 function in PHP?<br />string md5(string)<br />Calculate the md5 hash of a string. The hash is a 32-character hexadecimal number. I use it to generate keys which I use to identify users etc. If I add random no techniques to it the md5 generated now will be totally different for the same string I am using.<br />11. Kumar said,<br />How can I load data from a text file into a table?<br />The mysql provides a LOAD DATA INFILE syntax. U can load data from a file. Gr8 tool but u need to make sure that<br />a) data is delimited<br />b) u match the colms and data correctly<br />dont use w/out first learning the syntax<br />12. Kumar said,<br />How can we know the number of days between two given dates using MySQL?<br />Use DATEDIFF()<br />>SELECT DATEDIFF(NOW(),’1947-08-15′);<br />will give u the exact no of days India got independence from British.<br />13. Kumar said,<br />How can we know the number of days between two given dates using PHP?<br />Simple arithmetic.<br />$date1 = date(”Y-m-d”);<br />$date2 = “1947-08-15″;<br />$days = (strtotime() - strtotime()) / (60 * 60 * 24);<br />echo ” No of $days we got independence from Britts”;<br />14. Kumar said,<br />How can we change the name of a column of a table?<br />How can we change the name and data type of a column of a table?<br />this will change the name of colm<br />> ALTER TABLE table_name CHANGE old_colm_name new_colm_name<br />this will change the name of colm and also the datatype<br />> ALTER TABLE table_name CHANGE old_colm_name new_colm_name [data type]<br />15. Kumar said,<br />What are the differences between drop a table and truncate a table?<br />>DROP TABLE table_name<br />Will DELETE the table and DATA<br />>TRUNCATE TABLE table_name<br />Will DELETE the table DATA not the table definition<br />16. Jigar said,<br />The structure of table view buyers is as follows:<br />+—————-+————-+——+—–+———+—————-+<br />| Field | Type | Null | Key | Default | Extra |<br />+—————-+————-+——+—–+———+—————-+<br />| user_pri_id | int(15) | | PRI | NULL | auto_increment |<br />| userid | varchar(10) | YES | | NULL | |<br />+—————-+————-+——+—–+———+—————-+<br />the value of user_pri_id the last row 2345 then What will happen in the following conditions?<br />Condition1: Delete all the rows and insert another row then. What is the starting value for this auto incremented field user_pri_id ,<br />Condition2: Delete the last row(having the field value 2345) and insert another row then. What is the value for this auto incremented field user_pri_id <br />Mr. Kumar has given its answer but if you have used mysql as backend and if you fire a query “delete from tablename” then in mysql it will reset auto index. so for condition one it will start from value 1. <br />for condition 2 it will start from n+1<br />17. Jigar said,<br />What is PEAR in PHP<br />PEAR is short for “PHP Extension and Application Repository” and is pronounced just like the fruit. The purpose of PEAR is to provide: <br />A structured library of open-sourced code for PHP users <br />A system for code distribution and package maintenance <br />A standard style for code written in PHP<br />The PHP Foundation Classes (PFC), <br />The PHP Extension Community Library (PECL), <br />A web site, mailing lists and download mirrors to support the PHP/PEAR community <br />PEAR is a community-driven project with the PEAR Group as the governing body. The project has been founded by Stig S. Bakken in 1999 and quite a lot of people have joined the project since then.<br />http://pear.php.net/manual/en/introduction.php<br />18. Nasim Abbas said,<br />A .66<br />select count(id) id ,sitename from tbl_sites group by sitename having id>1;<br />19. Sergej said,<br />What is the difference between GROUP BY and ORDER BY in Sql?<br />ORDER BY [col1],[col2],…,[coln]; Tels DBMS according to what columns it should sort the result. If two rows will hawe the same value in col1 it will try to sort them according to col2 and so on.<br />GROUP BY [col1],[col2],…,[coln]; Tels DBMS to group results with same value of column col1. You can use COUNT(col1), SUM(col1), AVG(col1) with it, if you want to count all items in group, sum all values or view average<br />20. Sergej said,<br />39. What is MIME?<br />MIME is Multipurpose Internet Mail Extensions is an internet standard for the format of e-mail. Howewer browsers also uses MIME standart to transmit files. MIME has a header wich is added to a begining of the data. When browser sees such header it shows the data as it would be a file (for example image)<br />some mimes:<br />audio/x-ms-wmp<br />image/png<br />aplication/x-shockwave-flash<br />21. pupu said,<br />44.How can we know that a session is started or not?<br />a session starts by session_start()function.<br />this session_start() is always declared in header portion.it always declares first.then we write session_register().<br />22. pupu said,<br />47.What are the differences between MySQL_fetch_array(), MySQL_fetch_object(), MySQL_fetch_row()?<br />Ans:- MySQL_fetch_array()->Fetch a result row as an associative array,numeric array.<br />MySQL_fetch_object()->Fetch a result row as an object.<br />MySQL_fetch_row()->Fetch a result set as an array().<br />23. Kripa said,<br />If we login more than one browser window at the same time with same user and after that we close one window then is the session is exist to other window or not.And if yes then why? or if no then why?<br />24. YQwe said,<br />If we login more than one browser window at the same time with same user and after that we close one window then is the session is exist to other window or not.And if yes then why? or if no then why?<br />session depends on browser. if browser is closed then session is lost. the session data will be deleted after session time out. if connection is lost and u recreate connection, then also sesssion will continue in the browser.<br />25. Abdu Rahiman said,<br />What is the maximum storage capacity of Mysql data,<br />Is Mysql not reliable, Why?<br />26. m. sivakumar said,<br />What are the database files stored in system?<br />Ans: data’s are stored in name.Myd<br />table Structure are name.$frm<br />Index tables are name.myi<br />27. m. sivakumar said,<br />what is the difference between groupby and order by in mysql?<br />Ans: Group by which is used to sort a table interms of colums<br />order by which is used to index a table by colum value<br />28. Moses Dinakran said,<br />Question No 47. <br />The difference between mysql_fetch_row() and mysql_fetch_array() is that the first returns the results in a numeric array ($row[0], $row[1] etc), while the latter returns a the results an array containing both numeric and associative keys ($row[”name”], $row[”email”] etc). mysql_fetch_object() returns an object ($row->name, $row->email etc).<br />29. sivakumar said,<br />difference between php4 and php5?<br />php4 cannot support oops concepts and zend engine1 will be used<br />in php5 support oops concepts and zends engine2 will be used<br />error supporting will increased in php5<br />xml and sqllite will be incresed in php5<br />30. amrita said,<br />if i have to use more than one forms in more than one function in javascript and use it in a single html page,how should it be done<br />31. Ashish Mathur said,<br />A.How can increase the performance of MySQL select query?<br />We can use LIMIT to stop MySql for further search in table after we have received our required no. of records, also we can use LEFT JOIN or RIGHT JOIN instead of full join in cases we have related data in two or more tables.<br />32. ALAGARSAMY said,<br />what about ob_start and ob_flush?<br />Ans:<br />ob_start is used to start the output buffer<br />ob_flush is used to refresh or clear the output buffer<br />33. Senthil said,<br />What is difference between MySql 4.0 and Mysql 5.0<br />34. nilanjan banerjee said,<br />what the difference between<br />mysql_connect and mysql_pconnect?<br />35. alagarsamy said,<br />father of pms<br />savan<br />36. siddhant singh said,<br />ALL MYSQL QUERY WHICH USED IN PHP.<br />1. mysql_connect<br />2. mysql_pconnect<br />3. mysql_select_db<br />4. mysql_query<br />5. mysql_fetch_array<br />6. mysql_fetch_assocs<br />7. mysql_fetch_row<br />8. mysql_fetch_object<br />9. mysql_close<br />10. mysql_fetch_field<br />11. mysql_fetch_leanth<br />12. mysql_fetch_affected_rows<br />13. mysql_create_db<br />14. mysql_data_seek<br />15. mysql_db_name<br />16. mysql_db_query<br />17. mysql_drop_db<br />18. mysql_error<br />19. mysql_field_flags<br />20. mysql_field_len<br />21. mysql_field_table<br />22. mysql_field_type<br />23. mysql_field_seek<br />24. mysql_free_result<br />25. mysql_insert_id<br />26. mysql_first_dbs<br />27. mysql_list_field<br />28. mysql_ping<br />29. mysql_hum_field<br />30. mysql_read_escape<br />can anyone tell me is this all complet query. which is used in php.<br />37. Rakesh Chandel said,<br />mysql_pconnect() is used to make a persistence connection to a database means that we can not close a persistence connection using mysql_close() also if a connection is already opened mysql_pconnect will use that connection and will not create another connection.<br />38. PHP interview questions, Part 1 | TechInterviews.com | « Interview questions for tech companies said,<br />[…] done? Read the second set of interview questions on PHP, or leave comments […]<br />39. Manokaran said,<br />What is Normalization ?<br />The process of simplifying a complex table into a simple form.<br />40. Manokaran said,<br />How many can ways we redirect from php page?<br />i. We can redirect from php page using header() function<br />ex:<br />—<br />header(”location:PAGE_NAME | PAGE_PATH”);<br />41. Meganathan said,<br />Different types of error reporting in php ?<br />error_reporting() function and its constant values<br />—————————————————<br />E_ERROR<br />E_WARNING<br />E_PARSE<br />E_NOTICE<br />E_CORE_ERROR<br />E_CORE_WARNING<br />E_COMPILE_ERROR<br />E_COMPILE_WARNING<br />E_USER_ERROR<br />E_USER_WARNING<br />E_USER_NOTICE<br />E_ALL<br />E_STRICT<br />E_RECOVERABLE_ERRORmickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com0tag:blogger.com,1999:blog-2432773273760438764.post-67181264532570847542009-10-01T15:37:00.000+05:302009-10-01T15:40:38.858+05:30INTERVIEW QUESTIONS PART 2<div><table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="525" style="width:393.75pt;mso-cellspacing:0in;mso-padding-alt:2.25pt 2.25pt 2.25pt 2.25pt"> <tbody><tr style="mso-yfti-irow:0;mso-yfti-firstrow:yes"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:1</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What are the differences between Get and post methods in form submitting.</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">give the case where we can use get and we can use post methods?</span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:1"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:1</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <h3><span style="font-size:12.0pt;font-family:"Calibri","sans-serif"; color:#6666FF">When to use GET or POST</span><span style="font-size:12.0pt; font-family:"Calibri","sans-serif""><o:p></o:p></span></h3> <p><span style="font-family:"Calibri","sans-serif"">The HTML 2.0 specification says, in section Form
<br /> Submission (and the HTML 4.0 specification repeats this with minor
<br /> stylistic changes):<o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">–>If the processing of a form is idempotent
<br /> (i.e. it has no lasting observable effect on the state of the
<br /> world), then the form method should be GET. Many database searches
<br /> have no visible side-effects and make ideal applications of query
<br /> forms.
<br /> –
<br /> –>If the service associated with the processing of a form has side
<br /> effects (for example, modification of a database or subscription to
<br /> a service), the method should be POST.<o:p></o:p></span></p> <h3><span style="font-size:12.0pt;font-family:"Calibri","sans-serif"; color:#6666FF">How the form data is transmitted?</span><span style="font-size:12.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></h3> <p><span style="font-family:"Calibri","sans-serif"">quotation from the HTML 4.0 specification<o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">–> If the method is “get” - -, the user agent
<br /> takes the value of action, appends a ? to it, then appends the form
<br /> data set, encoded using the application/x-www-form-urlencoded
<br /> content type. The user agent then traverses the link to this URI. In
<br /> this scenario, form data are restricted to ASCII codes.
<br /> –> If the method is “post” –, the user agent conducts an HTTP post
<br /> transaction using the value of the action attribute and a message
<br /> created according to the content type specified by the enctype
<br /> attribute.<o:p></o:p></span></p> <h3><span style="font-size:12.0pt;font-family:"Calibri","sans-serif"; color:#6666FF">Quote from CGI FAQ</span><span style="font-size:12.0pt; font-family:"Calibri","sans-serif""><o:p></o:p></span></h3> <p><span style="font-family:"Calibri","sans-serif"">Firstly, the the HTTP protocol specifies
<br /> differing usages for the two methods. GET requests should always be
<br /> idempotent on the server. This means that whereas one GET request
<br /> might (rarely) change some state on the Server, two or more
<br /> identical requests will have no further effect.<o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">This is a theoretical point which is also good
<br /> advice in practice. If a user hits “reload” on his/her browser, an
<br /> identical request will be sent to the server, potentially resulting
<br /> in two identical database or
<br /> guestbook entries, counter increments, etc. Browsers may reload a
<br /> GET URL automatically, particularly if cacheing is disabled (as is
<br /> usually the case with CGI output), but will typically prompt the
<br /> user before
<br /> re-submitting a POST request. This means you’re far less likely to
<br /> get inadvertently-repeated entries from POST.<o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">GET is (in theory) the preferred method for
<br /> idempotent operations, such as querying a database, though it
<br /> matters little if you’re using a form. There is a further practical
<br /> constraint that many systems have built-in limits to the length of a
<br /> GET request they can handle: when the total size of a request (URL+params)
<br /> approaches or exceeds 1Kb, you are well-advised to use POST in any
<br /> case.<o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">I would prefer POST when I don’t want the status to
<br /> be change when user resubmits. And GET
<br /> when it does not matter.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:2"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:3"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:2</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Who is the father of PHP and explain the changes in PHP versions?</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:4"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:2</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">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
<br /> is the successor to PHP/FI 2.0 and is a lot nicer. PHP 4 is the current
<br /> generation of PHP, which uses the
<br /> Zend engine
<br /> under the
<br /> hood. PHP 5 uses
<br /> Zend engine 2 which,
<br /> among other things, offers many additionalOOP features<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:5"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:6"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:3</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we submit a form without a submit button? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:7"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:3</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">The main idea behind this is to use Java script submit() function in
<br /> order to submit the form without explicitly clicking any submit button.
<br /> You can attach the document.formname.submit() method to onclick,
<br /> onchange events of different inputs and perform the form submission. you
<br /> can even built a timer function where you can automatically submit the
<br /> form after xx seconds once the loading is done (can be seen in online
<br /> test sites).<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:8"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:9"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:4</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">In how many ways we can retrieve the data in the result set of</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">MySQL using PHP? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:10"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:4</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">You can do it by 4 Ways1. mysql_fetch_row.
<br /> 2. mysql_fetch_array
<br /> 3. mysql_fetch_object
<br /> 4. mysql_fetch_assoc<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:11"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:12"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:5</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What is the difference between mysql_fetch_object and</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">mysql_fetch_array? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:13"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:5</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">mysql_fetch_object()</span></strong><span style="font-family:"Calibri","sans-serif""> is similar to<strong><span style="font-family:"Calibri","sans-serif"">mysql_fetch_array()</span></strong>, with one difference -
<br /> an object is returned, instead of an array. Indirectly, that means that
<br /> you can only access the data by the field names, and not by their
<br /> offsets (numbers are illegal property names).<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:14"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:15"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:6</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What is the difference between $message and $$message? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:16"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:6</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">It is a classic example of PHP’s variable variables. take the
<br /> following example.$message = “Mizan”;$$message = “is a moderator of PHPXperts.”;$message is a simple PHP variable that we are used to. But the
<br /> $$message is not a very familiar face. It creates a variable name $mizan
<br /> with the value “is a moderator of PHPXperts.” assigned. break it like
<br /> this${$message} => $mizanSometimes it is convenient to be able to have variable variable
<br /> names. That is, a variable name which can be set and used dynamically.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:17"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:18"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:7</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we extract string ‘abc.com ‘ from a string ‘http://info@abc.com’</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">using regular expression of PHP? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:19"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:7</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">preg_match(”/^http:\/\/.+@(.+)$/”,’http://info@abc.com’,$found);
<br /> echo $found[1];<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:20"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:21"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:8</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we create a database using PHP and MySQL? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:22"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:8</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">We can create MySQL database with the use of
<br /> mysql_create_db(“Database Name”)<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:23"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:24"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:9</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What are the differences between require and include,</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">include_once and require_once? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:25"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:9</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="sect1"><span style="font-family:"Calibri","sans-serif"">The <strong><span style="font-family:"Calibri","sans-serif"">include()</span></strong> statement includes
<br /> and evaluates the specified file.The documentation below also applies to
<br /> <strong><span style="font-family:"Calibri","sans-serif"">require()</span></strong>. The two constructs
<br /> are identical in every way except how they handle
<br /> failure. <strong><span style="font-family:"Calibri","sans-serif"">include()</span></strong> produces a
<br /> Warning while <strong><span style="font-family:"Calibri","sans-serif"">require()</span></strong> results
<br /> in a Fatal Error. In other words, use
<br /> <strong><span style="font-family:"Calibri","sans-serif"">require()</span></strong> if you want a missing
<br /> file to halt processing of the page. <b>
<br /> <strong><span style="font-family:"Calibri","sans-serif"">include()</span></strong></b> does not behave this way, the script will
<br /> continue regardless.<o:p></o:p></span></p> <p class="sect1"><span style="font-family:"Calibri","sans-serif"">The <strong><span style="font-family:"Calibri","sans-serif"">include_once()</span></strong>
<br /> statement includes and evaluates the
<br /> specified file during the execution of
<br /> the script. This is a behavior similar
<br /> to the <strong><span style="font-family:"Calibri","sans-serif"">include()</span></strong>
<br /> statement, with the only difference
<br /> being that if the code from a file has
<br /> already been included, it will not be
<br /> included again. As the name suggests, it
<br /> will be included just once.<strong><span style="font-family:"Calibri","sans-serif"">include_once()</span></strong>
<br /> should be used in cases where the same
<br /> file might be included and evaluated
<br /> more than once during a particular
<br /> execution of a script, and you want to
<br /> be sure that it is included exactly once
<br /> to avoid problems with function
<br /> redefinitions, variable value
<br /> reassignments, etc.<o:p></o:p></span></p> <p><strong><span style="font-family:"Calibri","sans-serif"">require_once()</span></strong><span style="font-family:"Calibri","sans-serif"">
<br /> should be used in cases where the same
<br /> file might be included and evaluated
<br /> more than once during a particular
<br /> execution of a script, and you want to
<br /> be sure that it is included exactly once
<br /> to avoid problems with function
<br /> redefinitions, variable value
<br /> reassignments, etc.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:26"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:27"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:10</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Can we use include (”abc.PHP”) two times in a PHP page “makeit.PHP”?</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:28"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:10</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Yes we can use include() more than one time in any page though it is
<br /> not a very good practice.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:29"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:30"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:11</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What are the different tables present in MySQL, which type of</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">table is generated when we are creating a table in the following syntax:</span></strong>
<br /> <strong><span style="font-family:"Calibri","sans-serif"">create table employee (eno int(2),ename varchar(10)) ? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:31"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:11</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Total 5 types of tables we can create
<br /> 1. MyISAM
<br /> 2. Heap
<br /> 3. Merge
<br /> 4. INNO DB
<br /> 5. ISAM
<br /> MyISAM is the default storage engine as of MySQL 3.23 and as a result if
<br /> we do not specify the table name explicitly it will be assigned to the
<br /> default engine.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:32"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:33"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:12</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Functions in IMAP, POP3 AND LDAP? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:34"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:12</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">You can find these specific information in PHP Manual.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:35"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:36"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:13</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can I execute a PHP script using command line? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:37"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:13</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">As of version 4.3.0, PHP supports a new SAPI type (Server
<br /> Application Programming Interface) named CLI which means Command Line
<br /> Interface. Just run the PHP CLI (Command Line Interface) program and
<br /> provide the PHP script file name as the command line argument. For
<br /> example, “php myScript.php”, assuming “php” is the command to invoke the
<br /> CLI program.
<br /> Be aware that if your PHP script was written for the Web CGI interface,
<br /> it may not execute properly in command line environment.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:38"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:39"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:14</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Suppose your Zend engine supports the mode <? ?> Then how can u</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">configure your PHP Zend engine to support <?PHP ?> mode ? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:40"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:14</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">In php.ini file:
<br /> set
<br /> <strong><span style="font-family:"Calibri","sans-serif"">short_open_tag=on</span></strong>
<br /> to make PHP support<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:41"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:42"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:15</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Shopping cart online validation i.e. how can we configure Paypal,</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">etc.? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:43"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:15</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">We can find the detail documentation about different paypal
<br /> integration process at the following site <o:p></o:p></span></p> <h2><span style="font-size:12.0pt;font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif";mso-bidi-font-family: Arial">PayPal PHP</span></strong>
<br /> SDK : </span><a href="http://www.paypaldev.org/"><span style="font-size:12.0pt; font-family:"Calibri","sans-serif"">http://www.paypaldev.org</span></a><span style="font-size:12.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></h2> </td> </tr> <tr style="mso-yfti-irow:44"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:45"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:16</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What is meant by nl2br()? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:46"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:16</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Inserts HTML line breaks (
<br /><!--[if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600" spt="75" preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"> <v:stroke joinstyle="miter"> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0"> <v:f eqn="sum @0 1 0"> <v:f eqn="sum 0 0 @1"> <v:f eqn="prod @2 1 2"> <v:f eqn="prod @3 21600 pixelWidth"> <v:f eqn="prod @3 21600 pixelHeight"> <v:f eqn="sum @0 0 1"> <v:f eqn="prod @6 1 2"> <v:f eqn="prod @7 21600 pixelWidth"> <v:f eqn="sum @8 21600 0"> <v:f eqn="prod @7 21600 pixelHeight"> <v:f eqn="sum @10 21600 0"> </v:formulas> <v:path extrusionok="f" gradientshapeok="t" connecttype="rect"> <o:lock ext="edit" aspectratio="t"> </v:shapetype><v:shape id="Picture_x0020_1" spid="_x0000_i1027" type="#_x0000_t75" alt=";)" style="'width:11.25pt;height:11.25pt;visibility:visible;"> <v:imagedata src="file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtmlclip1\01\clip_image001.gif" title=";)"> </v:shape><![endif]--><img border="0" width="15" height="15" src="file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtmlclip1/01/clip_image001.gif" alt=";)" shapes="Picture_x0020_1" /></span>before all newlines in a string
<br /> string nl2br (string); Returns string with ” inserted before all
<br /> newlines. For example: echo nl2br(”god bless\n you”) will output “god
<br /> bless <br /> you” to your browser.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:47"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:48"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:17</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Draw the architecture of Zend engine? </span></strong><span style="font-family: "Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:49"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:17</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">The Zend Engine is the internal compiler and runtime engine used by
<br /> PHP4. Developed by Zeev Suraski and Andi Gutmans, the Zend Engine is an
<br /> abbreviation of their names. In the early days of PHP4, it worked as
<br /> follows:</span><a href="http://photos1.blogger.com/blogger/6545/2077/1600/Image2.gif"><span style="font-family:"Calibri","sans-serif"">
<br /> </span><span style="font-family:"Calibri","sans-serif";mso-no-proof:yes; text-decoration:none;text-underline:none"><!--[if gte vml 1]><v:shape id="Picture_x0020_2" spid="_x0000_i1026" type="#_x0000_t75" alt="Image2" style="'width:207.75pt;"> <v:imagedata src="file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtmlclip1\01\clip_image002.gif" title="Image2"> </v:shape><![endif]--><img border="0" width="277" height="207" src="file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtmlclip1/01/clip_image002.gif" alt="Image2" shapes="Picture_x0020_2" /></span></a><span style="font-family:"Calibri","sans-serif"">The PHP script was loaded by the Zend Engine and compiled into Zend
<br /> opcode. Opcodes, short for operation codes, are low level binary
<br /> instructions. Then the opcode was executed and the HTML generated sent
<br /> to the client. The opcode was flushed from memory after execution.Today, there are a multitude of products and techniques to help you
<br /> speed up this process. In the following diagram, we show the how modern
<br /> PHP scripts work; all the shaded boxes are optional.</span><a href="http://photos1.blogger.com/blogger/6545/2077/1600/php-zend.gif"><span style="font-family:"Calibri","sans-serif"">
<br /> </span><span style="font-family:"Calibri","sans-serif";mso-no-proof:yes; text-decoration:none;text-underline:none"><!--[if gte vml 1]><v:shape id="Picture_x0020_3" spid="_x0000_i1025" type="#_x0000_t75" alt="php-zend" style="'width:300pt;"> <v:imagedata src="file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtmlclip1\01\clip_image003.jpg" title="php-zend"> </v:shape><![endif]--><img border="0" width="400" height="267" src="file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtmlclip1/01/clip_image003.jpg" alt="php-zend" shapes="Picture_x0020_3" /></span></a><span style="font-family:"Calibri","sans-serif"">PHP Scripts are loaded into memory and compiled into Zend opcodes.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:50"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:51"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:18</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What are the current versions of apache, PHP, and MySQL? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:52"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:18</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">As of February, 2007 the current versions arePHP: php5.2.1
<br /> MySQL: MySQL 5.2
<br /> Apache: Apache 2.2.4Note: visit </span><a href="http://www.php.net/"><span style="font-family:"Calibri","sans-serif"">www.php.net</span></a><span style="font-family:"Calibri","sans-serif"">,
<br /> </span><a href="http://dev.mysql.com/downloads/mysql/"><span style="font-family:"Calibri","sans-serif"">
<br /> http://dev.mysql.com/downloads/mysql/</span></a><span style="font-family: "Calibri","sans-serif"">,
<br /> </span><a href="http://www.apache.org/"><span style="font-family:"Calibri","sans-serif"">www.apache.org</span></a><span style="font-family:"Calibri","sans-serif""> to get current
<br /> versions.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:53"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:54"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:19</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What are the reasons for selecting lamp (Linux, apache, MySQL,</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">PHP) instead of combination of other software programs, servers and</span></strong>
<br /> <strong><span style="font-family:"Calibri","sans-serif"">operating systems? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:55"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:19</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">All of those are open source resource. Security of Linux is very
<br /> very more than windows. Apache is a better server that IIS both in
<br /> functionality and security. MySQL is world most popular open source
<br /> database. PHP is more faster that asp or any other scripting language.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:56"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:57"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:20</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we encrypt and decrypt a data present in a MySQL table</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">using MySQL? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:58"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:20</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">AES_ENCRYPT () and AES_DECRYPT ()<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:59"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:60"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:21</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we encrypt the username and password using PHP? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:61"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:21</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">The functions in this section perform encryption and decryption, and
<br /> compression and uncompression: <o:p></o:p></span></p> <table class="MsoNormalTable" border="1" cellpadding="0" style="mso-cellspacing: 1.5pt"> <tbody><tr style="mso-yfti-irow:0;mso-yfti-firstrow:yes"> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">encryption</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">decryption</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:1"> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">AES_ENCRYT()<o:p></o:p></span></p> </td> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">AES_DECRYPT()<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:2"> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">ENCODE()<o:p></o:p></span></p> </td> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">DECODE()<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:3"> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">DES_ENCRYPT()<o:p></o:p></span></p> </td> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">DES_DECRYPT()<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:4"> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">ENCRYPT()<o:p></o:p></span></p> </td> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Not available<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:5"> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">MD5()<o:p></o:p></span></p> </td> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Not available<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:6"> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">OLD_PASSWORD()<o:p></o:p></span></p> </td> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Not available<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:7"> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">PASSWORD()<o:p></o:p></span></p> </td> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Not available<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:8"> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">SHA() or SHA1()<o:p></o:p></span></p> </td> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Not available<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:9;mso-yfti-lastrow:yes"> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Not available<o:p></o:p></span></p> </td> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">UNCOMPRESSED_LENGTH()<o:p></o:p></span></p> </td> </tr> </tbody></table> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:62"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:63"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:22</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What are the features and advantages of object-oriented</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">programming? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:64"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:22</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">One of the main advantages of OO programming is its ease of
<br /> modification; objects can easily be modified and added to a system there
<br /> by reducing maintenance costs. OO programming is also considered to be
<br /> better at modeling the real world than is procedural programming. It
<br /> allows for more complicated and flexible interactions. OO systems are
<br /> also easier for non-technical personnel to understand and easier for
<br /> them to participate in the maintenance and enhancement of a system
<br /> because it appeals to natural human cognition patterns.
<br /> For some systems, an OO approach can speed development time since many
<br /> objects are standard across systems and can be reused. Components that
<br /> manage dates, shipping, shopping carts, etc. can be purchased and easily
<br /> modified for a specific system<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:65"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:66"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:23</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What are the differences between procedure-oriented languages and</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">object-oriented languages? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:67"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:23</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Traditional programming has the following characteristics:Functions are written sequentially, so that a change in programming can
<br /> affect any code that follows it.
<br /> If a function is used multiple times in a system (i.e., a piece of code
<br /> that manages the date), it is often simply cut and pasted into each
<br /> program (i.e., a change log, order function, fulfillment system, etc).
<br /> If a date change is needed (i.e., Y2K when the code needed to be changed
<br /> to handle four numerical digits instead of two), all these pieces of
<br /> code must be found, modified, and tested.
<br /> Code (sequences of computer instructions) and data (information on which
<br /> the instructions operates on) are kept separate. Multiple sets of code
<br /> can access and modify one set of data. One set of code may rely on data
<br /> in multiple places. Multiple sets of code and data are required to work
<br /> together. Changes made to any of the code sets and data sets can cause
<br /> 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
<br /> term “component” has also been used to describe an object.) An object is
<br /> an abstraction of a set of real-world things (for example, an object may
<br /> be created around “date”) The object would contain all information and
<br /> functionality for that thing (A date
<br /> object it may contain labels like January, February, Tuesday, Wednesday.
<br /> It may contain functionality that manages leap years, determines if it
<br /> is a business day or a holiday, etc., See Fig. 1). Ideally, information
<br /> about a particular thing should reside in only one place in a system.
<br /> The information within an object is encapsulated (or hidden) from the
<br /> rest of the system.
<br /> A system is composed of multiple objects (i.e., date function, reports,
<br /> order processing, etc., See Fig 2). When one object needs information
<br /> from another object, a request is sent asking for specific information.
<br /> (for example, a report object may need to know what today’s date is and
<br /> will send a request to the date object) These requests are called
<br /> messages and each object has an interface that manages messages.
<br /> OO programming languages include features such as “class”, “instance”,
<br /> “inheritance”, and “polymorphism” that increase the power and
<br /> flexibility of an object.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:68"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:69"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:24</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What is the use of friend function? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:70"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:24</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Sometimes a function is best shared among a number of different
<br /> classes. Such functions can be declared either as member functions of
<br /> one class or as global functions. In either case they can be set to be
<br /> friends of other classes, by using a friend specifier in the class that
<br /> is admitting them. Such functions can use all attributes of the class
<br /> which names them as a friend, as if they were themselves members of that
<br /> class.
<br /> A friend declaration is essentially a prototype for a member function,
<br /> but instead of requiring an implementation with the name of that class
<br /> attached by the double colon syntax, a global function or member
<br /> function of another class provides the match.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:71"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:72"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:25</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What are the differences between public, private, protected,</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">static, transient, final and volatile? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:73"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:25</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Public:</span></strong><span style="font-family:"Calibri","sans-serif""> Public declared items can be accessed everywhere.
<br /> <strong><span style="font-family:"Calibri","sans-serif"">Protected:</span></strong> Protected limits access to inherited and parent
<br /> classes (and to the class that defines the item).
<br /> <strong><span style="font-family:"Calibri","sans-serif"">Private:</span></strong> Private limits visibility only to the class that defines
<br /> the item.
<br /> <strong><span style="font-family:"Calibri","sans-serif"">Static:</span></strong> A static variable exists only in a local function scope,
<br /> but it does not lose its value when program execution leaves this scope.
<br /> <strong><span style="font-family:"Calibri","sans-serif"">Final:</span></strong> Final keyword prevents child classes from overriding a
<br /> method by prefixing the definition with final. If the class itself is
<br /> being defined final then it cannot be extended.
<br /> <strong><span style="font-family:"Calibri","sans-serif"">transient: </span></strong>A transient variable is a variable that may not
<br /> be serialized. <b>
<br /> <strong><span style="font-family:"Calibri","sans-serif"">volatile:</span></strong></b> a variable that might be concurrently modified by multiple
<br /> threads should be declared volatile. Variables declared to be volatile
<br /> will not be optimized by the compiler because their value can change at
<br /> any time.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:74"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:75"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:26</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What are the different types of errors in PHP? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:76"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:26</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Three are three types of errors:1. Notices: These are trivial,
<br /> non-critical errors that PHP encounters while executing a script - for
<br /> example, accessing a variable that has not yet been defined. By default,
<br /> such errors are not displayed to the user at all - although, as you will
<br /> see, you can change this default behavior.2. Warnings: These are more serious errors - for example, attempting
<br /> to include() a file which does not exist. By default, these errors are
<br /> displayed to the user, but they do not result in script termination.3. Fatal errors: These are critical errors - for example,
<br /> instantiating an object of a non-existent class, or calling a
<br /> non-existent function. These errors cause the immediate termination of
<br /> the script, and PHP’s default behavior is to display them to the user
<br /> when they take place.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:77"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:78"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:27</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What is the functionality of the function strstr and stristr? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:79"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:27</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">strstr: <o:p></o:p></span></p> <p class="refsect1"><span style="font-family:"Calibri","sans-serif"">Returns part of <var><span style="font-family:"Calibri","sans-serif"">haystack</span></var>
<br /> string from the first occurrence of
<br /> <var><span style="font-family:"Calibri","sans-serif"">needle</span></var> to the end of
<br /> <var><span style="font-family:"Calibri","sans-serif"">haystack</span></var>.If <var><span style="font-family:"Calibri","sans-serif"">needle</span></var> is not found,
<br /> returns </span><tt><span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">FALSE</span></tt><span style="font-family:"Calibri","sans-serif"">.<o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">If <var><span style="font-family:"Calibri","sans-serif"">needle</span></var> is not a
<br /> string, it is converted to an integer and applied as the
<br /> ordinal value of a character.<o:p></o:p></span></p> <p class="note"><span style="font-family:"Calibri","sans-serif"">This function is case-sensitive. For
<br /> case-insensitive searches, use
<br /> <strong><span style="font-family:"Calibri","sans-serif"">stristr()</span></strong>.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:80"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:81"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:28</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What are the differences between PHP 3 and PHP 4 and PHP 5? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:82"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:28</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Please read the release notes at
<br /> </span><a href="http://php.net./"><span style="font-family:"Calibri","sans-serif"">http://www.php.net.</span></a><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:83"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:84"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:29</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we convert asp pages to PHP pages? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:85"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:29</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">there are lots of tools available for asp to PHP conversion. you can
<br /> search Google for that. the best one is available at</span><a href="http://asp2php.naken.cc./"><span style="font-family:"Calibri","sans-serif"">http://asp2php.naken.cc./</span></a><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:86"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:87"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:30</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What is the functionality of the function htmlentities? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:88"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:30</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Convert all applicable characters to HTML entities
<br /> This function is identical to htmlspecialchars() in all ways, except
<br /> with htmlentities(), all characters which have HTML character entity
<br /> equivalents are translated into these entities.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:89"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:90"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:31</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we get second of the current time using date function?</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:91"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:31</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">$second = date(”s”);<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:92"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:93"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:32</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we convert the time zones using PHP? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:94"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:32</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><tt><span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">By using date_default_timezone_get</span></tt><span style="font-family:"Calibri","sans-serif""> and </span><span style="font-family:"Calibri","sans-serif";mso-bidi-font-family: "Courier New"">
<br /> </span><tt><span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">date_default_timezone_set function on PHP 5.1.0</span></tt><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> <pre><span style="font-size:12.0pt;font-family:"Calibri","sans-serif""><?php<o:p></o:p></span></pre><pre><span style="font-size:12.0pt;font-family:"Calibri","sans-serif"">// Discover what 8am in Tokyo relates to on the East Coast of the US<span style="mso-spacerun:yes"> </span><o:p></o:p></span></pre><pre><span style="font-size:12.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></pre><pre><span style="font-size:12.0pt;font-family:"Calibri","sans-serif"">// Set the default timezone to Tokyo time:<o:p></o:p></span></pre><pre><span style="font-size:12.0pt;font-family:"Calibri","sans-serif"">date_default_timezone_set('Asia/Tokyo');<span style="mso-spacerun:yes"> </span><o:p></o:p></span></pre><pre><span style="font-size:12.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></pre><pre><span style="font-size:12.0pt;font-family:"Calibri","sans-serif"">// Now generate the timestamp for that particular timezone, on Jan 1st, 2000<o:p></o:p></span></pre><pre><span style="font-size:12.0pt;font-family:"Calibri","sans-serif"">$stamp = mktime(8, 0, 0, 1, 1, 2000);<span style="mso-spacerun:yes"> </span><o:p></o:p></span></pre><pre><span style="font-size:12.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></pre><pre><span style="font-size:12.0pt;font-family:"Calibri","sans-serif"">// Now set the timezone back to US/Eastern<o:p></o:p></span></pre><pre><span style="font-size:12.0pt;font-family:"Calibri","sans-serif"">date_default_timezone_set('US/Eastern');<span style="mso-spacerun:yes"> </span><o:p></o:p></span></pre><pre><span style="font-size:12.0pt;font-family:"Calibri","sans-serif""><o:p> </o:p></span></pre><pre><span style="font-size:12.0pt;font-family:"Calibri","sans-serif"">// Output the date in a standard format (RFC1123), this will print:<o:p></o:p></span></pre><pre><span style="font-size:12.0pt;font-family:"Calibri","sans-serif"">// Fri, 31 Dec 1999 18:00:00 EST<o:p></o:p></span></pre><pre><span style="font-size:12.0pt;font-family:"Calibri","sans-serif"">echo '<p>', date(DATE_RFC1123, $stamp) ,'</p>';?><o:p></o:p></span></pre></td> </tr> <tr style="mso-yfti-irow:95"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:96"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:33</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What is meant by urlencode and urldocode? </span></strong><span style="font-family: "Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:97"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:33</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">URLencode returns a string in which all non-alphanumeric characters
<br /> except </span><tt><span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">-_.</span></tt><span style="font-family:"Calibri","sans-serif""> have been replaced with a percent (</span><tt><span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">%</span></tt><span style="font-family:"Calibri","sans-serif"">)
<br /> sign followed by two hex digits and spaces encoded as plus (</span><tt><span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">+</span></tt><span style="font-family:"Calibri","sans-serif"">)
<br /> signs. It is encoded the same way that the posted data from a WWW form
<br /> is encoded, that is the same way as in </span><span style="font-family:"Calibri","sans-serif"; mso-bidi-font-family:"Courier New"">
<br /> </span><tt><span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">application/x-www-form-urlencoded</span></tt><span style="font-family:"Calibri","sans-serif""> media type. <o:p></o:p></span></p> <p class="refsect1"><span style="font-family:"Calibri","sans-serif"">urldecode decodes any </span><tt><span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">%<i>##</i></span></tt><span style="font-family:"Calibri","sans-serif"">
<br /> encoding in the given string.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:98"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:99"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:34</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What is the difference between the functions unlink and unset?</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:100"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:34</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">unlink() deletes the given file from the file system.
<br /> unset() makes a variable undefined.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:101"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:102"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:35</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we register the variables into a session? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:103"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:35</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">$_SESSION[’name’] = “Mizan”;<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:104"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:105"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:36</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we get the properties (size, type, width, height) of an</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">image using PHP image functions? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:106"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:36</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">To know the Image type use exif_imagetype () function
<br /> To know the Image size use getimagesize () function
<br /> To know the image width use imagesx () function
<br /> To know the image height use imagesy() function t<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:107"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:108"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:37</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we get the browser properties using PHP? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:109"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:37</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">By using </span><span style="font-family:"Calibri","sans-serif";mso-bidi-font-family:"Courier New"">
<br /> </span><code><span style="font-size:10.0pt;font-family:"Calibri","sans-serif"; color:black">$_SERVER['HTTP_USER_AGENT']</span></code><span style="font-family: "Calibri","sans-serif";mso-bidi-font-family:"Courier New";color:#007700">
<br /> </span><code><span style="font-size:10.0pt;font-family:"Calibri","sans-serif"; color:black">variable</span></code><code><span style="font-size:10.0pt; font-family:"Calibri","sans-serif";color:#007700">. </span></code><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:110"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:111;height:17.25pt"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt; height:17.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:38</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt;height: 17.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What is the maximum size of a file that can be uploaded using PHP</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">and how can we change this? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:112"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:38</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">By default the maximum size is 2MB. and we can change the following
<br /> setup at php.iniupload_max_filesize = 2M<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:113"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:114"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:39</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we increase the execution time of a PHP script? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:115"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:39</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">by changing the following setup at php.inimax_execution_time = 30
<br /> ; Maximum execution time of each script, in seconds<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:116"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:117"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:40</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we take a backup of a MySQL table and how can we restore</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">it. ? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:118"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:40</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">To backup: BACKUP TABLE tbl_name[,tbl_name…] TO
<br /> ‘/path/to/backup/directory’
<br /> 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
<br /> for transferring the data to another SQL server (not necessarily a MySQL
<br /> server). The dump will contain SQL statements to create the table and/or
<br /> populate the table.
<br /> -t, –no-create-info
<br /> Don’t write table creation information (the CREATE TABLE statement).
<br /> -d, –no-data
<br /> Don’t write any row information for the table. This is very useful if
<br /> you just want to get a dump of the structure for a table!<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:119"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:120"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:41</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we optimize or increase the speed of a MySQL select</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">query? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:121"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:41</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <ul type="disc"> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt: auto;mso-list:l0 level1 lfo1;tab-stops:list .5in"><span style="font-family:"Calibri","sans-serif"">first of all instead of using select * from table1, use select
<br /> column1, column2, column3.. from table1 <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt: auto;mso-list:l0 level1 lfo1;tab-stops:list .5in"><span style="font-family:"Calibri","sans-serif"">Look for the opportunity to introduce index in the table you are
<br /> querying. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt: auto;mso-list:l0 level1 lfo1;tab-stops:list .5in"><span style="font-family:"Calibri","sans-serif"">use limit keyword if you are looking for any specific number of
<br /> rows from the result set. <o:p></o:p></span></li> </ul> </td> </tr> <tr style="mso-yfti-irow:122"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:123"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:42</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How many ways can we get the value of current session id? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:124"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:42</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">session_id() returns the session id for the current session.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:125"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:126"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:43</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we destroy the session, how can we unset the variable of</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">a session? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:127"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:43</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">session_unregister — Unregister a global variable from the current
<br /> session
<br /> session_unset — Free all session variables<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:128"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:129"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:44</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we destroy the cookie? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:130"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:44</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Set the cookie in past.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:131"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:132"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:45</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How many ways we can pass the variable through the navigation</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">between the pages? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:133"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:45</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <ul type="disc"> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt: auto;mso-list:l2 level1 lfo2;tab-stops:list .5in"><span style="font-family:"Calibri","sans-serif"">GET/QueryString <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt: auto;mso-list:l2 level1 lfo2;tab-stops:list .5in"><span style="font-family:"Calibri","sans-serif"">POST <o:p></o:p></span></li> </ul> </td> </tr> <tr style="mso-yfti-irow:134"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:135"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:46</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What is the difference between ereg_replace() and eregi_replace()?</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:136"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:46</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">eregi_replace() function is identical to ereg_replace() except that
<br /> this ignores case distinction when matching alphabetic
<br /> characters.eregi_replace() function is identical to ereg_replace()
<br /> except that this ignores case distinction when matching alphabetic
<br /> characters.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:137"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:138"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:47</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What are the different functions in sorting an array? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:139"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:47</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Sort(), arsort(),
<br /> asort(), ksort(),
<br /> natsort(), natcasesort(),
<br /> rsort(), usort(),
<br /> array_multisort(), and
<br /> uksort().<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:140"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:141"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:48</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we know the count/number of elements of an array? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:142"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:48</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">2 ways
<br /> a) sizeof($urarray) This function is an alias of count()
<br /> b) count($urarray)<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:143"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:144"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:49</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What is the PHP predefined variable that tells the What types of</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">images that PHP supports? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:145"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:49</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Though i am not sure if this is wrong or not, With the exif
<br /> extension you are able to work with image meta data.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:146"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:147"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:50</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can I know that a variable is a number or not using a</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">JavaScript? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:148"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:50</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">bool is_numeric ( mixed var)
<br /> 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.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:149"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:150"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:51</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">List out some tools through which we can draw E-R diagrams for</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">mysql. </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:151"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:51</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Case Studio
<br /> Smart Draw<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:152"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:153"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:52</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can I retrieve values from one database server and store them</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">in other database server using PHP? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:154"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:52</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">we can always fetch from one database and rewrite to another. here
<br /> is a nice solution of it.$db1 = mysql_connect(”host”,”user”,”pwd”)
<br /> mysql_select_db(”db1</span><span style="font-family:"Verdana","sans-serif"">″</span><span style="font-family:"Calibri","sans-serif"">, $db1);
<br /> $res1 = mysql_query(”query”,$db1);$db2 = mysql_connect(”host”,”user”,”pwd”)
<br /> mysql_select_db(”db2</span><span style="font-family:"Verdana","sans-serif"">″</span><span style="font-family:"Calibri","sans-serif"">, $db2);
<br /> $res2 = mysql_query(”query”,$db2);At this point you can only fetch records from you previous ResultSet,
<br /> i.e $res1 - But you cannot execute new query in $db1, even if you
<br /> supply the link as because the link was overwritten by the new db.so at this point the following script will fail
<br /> $res3 = mysql_query(”query”,$db1); //this will failSo how to solve that? <o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">take a look below.
<br /> $db1 = mysql_connect(”host”,”user”,”pwd”)
<br /> mysql_select_db(”db1</span><span style="font-family:"Verdana","sans-serif"">″</span><span style="font-family:"Calibri","sans-serif"">, $db1);
<br /> $res1 = mysql_query(”query”,$db1);<o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">$db2 = mysql_connect(”host”,”user”,”pwd”, true)
<br /> mysql_select_db(”db2</span><span style="font-family:"Verdana","sans-serif"">″</span><span style="font-family:"Calibri","sans-serif"">, $db2);
<br /> $res2 = mysql_query(”query”,$db2);<o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">So mysql_connect has another optional boolean parameter which
<br /> indicates whether a link will be created or not. as we connect to the
<br /> $db2 with this optional parameter set to ‘true’, so both link will
<br /> remain live.<o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">now the following query will execute successfully.
<br /> $res3 = mysql_query(”query”,$db1);<o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">Thanks goes to Hasan and Hasin for this solution.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:155"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:156"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:53</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">List out the predefined classes in PHP? </span></strong><span style="font-family: "Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:157"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:53</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Directory
<br /> stdClass
<br /> __PHP_Incomplete_Class
<br /> exception
<br /> php_user_filter<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:158"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:159"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:54</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can I make a script that can be bi-language (supports</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">English, German)? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:160"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:54</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">You can maintain two separate language file for each of the
<br /> language. all the labels are putted in both language files as variables
<br /> and assign those variables in the PHP source. on runtime choose the
<br /> required language option.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:161"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:162"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:55</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What are the difference between abstract class and interface? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:163"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:55</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Abstract class: abstract classes are the class where one or more
<br /> methods are abstract but not necessarily all method has to be abstract.
<br /> Abstract methods are the methods, which are declare in its class but not
<br /> define. The definition of those methods must be in its extending class.Interface: Interfaces are one type of class where all the methods are
<br /> abstract. That means all the methods only declared but not defined. All
<br /> the methods must be define by its implemented class.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:164"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:165"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:56</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we send mail using JavaScript? </span></strong><span style="font-family: "Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:166"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:56</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">JavaScript does not have any networking capabilities as it is
<br /> designed to work on client site. As a result we can not send mails using
<br /> JavaScript. But we can call the client side mail protocol <strong><span style="font-family:"Calibri","sans-serif"">mailto</span></strong>
<br /> via JavaScript to prompt for an email to send. this requires the client
<br /> to approve it.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:167"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:168"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:57</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we repair a MySQL table? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:169"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:57</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">The syntex for repairing a MySQL table is
<br /> REPAIR TABLENAME, [TABLENAME, ], [Quick],[Extended]
<br /> This command will repair the table specified if the quick is given the
<br /> MySQL will do a repair of only the index tree if the extended is given
<br /> it will create index row by row<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:170"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:171"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:58</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What are the advantages of stored procedures, triggers, indexes?</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:172"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:58</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">A stored procedure is a set of SQL commands that can be compiled and
<br /> stored in the server. Once this has been done, clients don’t need to
<br /> keep re-issuing the entire query but can refer to the stored procedure.
<br /> This provides better overall performance because the query has to be
<br /> parsed only once, and less information needs to be sent between the
<br /> server and the client. You can also raise the conceptual level by having
<br /> libraries of functions in the server. However, stored procedures of
<br /> course do increase the load on the database server system, as more of
<br /> the work is done on the server side and less on the client (application)
<br /> side.Triggers will also be implemented. A trigger is effectively a type of
<br /> stored procedure, one that is invoked when a particular event occurs.
<br /> For example, you can install a stored procedure that is triggered each
<br /> time a record is deleted from a transaction table and that stored
<br /> procedure automatically deletes the corresponding customer from a
<br /> customer table when all his transactions are deleted.Indexes are used to find rows with specific column values quickly.
<br /> Without an index, MySQL must begin with the first row and then read
<br /> through the entire table to find the relevant rows. The larger the
<br /> table, the more this costs. If the table has an index for the columns in
<br /> question, MySQL can quickly determine the position to seek to in the
<br /> middle of the data file without having to look at all the data. If a
<br /> table has 1,000 rows, this is at least 100 times faster than reading
<br /> sequentially. If you need to access most of the rows, it is faster to
<br /> read sequentially, because this minimizes disk seeks.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:173"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:174"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:59</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What is the maximum length of a table name, database name, and</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">fieldname in MySQL? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:175"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:59</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">The following table describes the maximum length for each type of
<br /> identifier. <o:p></o:p></span></p> <table class="MsoNormalTable" border="1" cellpadding="0" style="mso-cellspacing: 1.5pt"> <tbody><tr style="mso-yfti-irow:0;mso-yfti-firstrow:yes"> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Identifier</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Maximum Length</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">(bytes)</span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:1"> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Database<o:p></o:p></span></p> </td> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">64<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:2"> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Table<o:p></o:p></span></p> </td> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">64<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:3"> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Column<o:p></o:p></span></p> </td> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">64<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:4"> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Index<o:p></o:p></span></p> </td> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">64<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:5;mso-yfti-lastrow:yes"> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Alias<o:p></o:p></span></p> </td> <td style="padding:.75pt .75pt .75pt .75pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">255<o:p></o:p></span></p> </td> </tr> </tbody></table> <p><span style="font-family:"Calibri","sans-serif"">There are some restrictions on the characters that may appear in
<br /> identifiers:<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:176"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:177"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:60</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How many values can the SET function of MySQL take? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:178"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:60</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">MySQL set can take zero or more values but at the maximum it can
<br /> take 64 values<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:179"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:180"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:61</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What are the other commands to know the structure of table using</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">MySQL commands except explain command? </span></strong></span></b><span style="font-family: "Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:181"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:61</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">describe Table-Name;<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:182"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:183"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:62</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How many tables will create when we create table, what are they?</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:184"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:62</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">The ‘.frm’ file stores the table definition.
<br /> The data file has a ‘.MYD’ (MYData) extension.
<br /> The index file has a ‘.MYI’ (MYIndex) extension,<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:185"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:186"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:63</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What is the purpose of the following files having extensions 1) .frm</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">2) .myd 3) .myi? What do these files contain? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:187"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:63</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">In MySql, the default table type is MyISAM.
<br /> Each MyISAM table is stored on disk in three files. The files have names
<br /> that begin with the table name and have an extension to indicate the
<br /> file type.
<br /> The ‘.fr<o:p></o:p></span></p> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">m’ file stores the table definition.
<br /> The data file has a ‘.MYD’ (MYData) extension.
<br /> The index file has a ‘.MYI’ (MYIndex) extension,<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:188"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:189"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:64</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What is maximum size of a database in MySQL? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:190"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:64</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">If the operating system or filesystem places a limit on the number
<br /> of files in a directory, MySQL is bound by that constraint.The efficiency of the operating system in handling large numbers of
<br /> files in a directory can place a practical limit on the number of tables
<br /> in a database. If the time required to open a file in the directory
<br /> increases significantly as the number of files increases, database
<br /> performance can be adversely affected.
<br /> The amount of available disk space limits the number of tables.
<br /> MySQL 3.22 had a 4GB (4 gigabyte) limit on table size. With the MyISAM
<br /> storage engine in MySQL 3.23, the maximum table size was increased to
<br /> 65536 terabytes (2567 – 1 bytes). With this larger allowed table size,
<br /> the maximum effective table size for MySQL databases is usually
<br /> determined by operating system constraints on file sizes, not by MySQL
<br /> internal limits.The InnoDB storage engine maintains InnoDB tables within a tablespace
<br /> that can be created from several files. This allows a table to exceed
<br /> the maximum individual file size. The tablespace can include raw disk
<br /> partitions, which allows extremely large tables. The maximum tablespace
<br /> size is 64TB.
<br /> The following table lists some examples of operating system file-size
<br /> limits. This is only a rough guide and is not intended to be definitive.
<br /> For the most up-to-date information, be sure to check the documentation
<br /> specific to your operating system.
<br /> Operating System File-size LimitLinux 2.2-Intel 32-bit 2GB (LFS: 4GB)
<br /> Linux 2.4+ (using ext3 filesystem) 4TB
<br /> Solaris 9/10 16TB
<br /> NetWare w/NSS filesystem 8TB
<br /> Win32 w/ FAT/FAT32 2GB/4GB
<br /> Win32 w/ NTFS 2TB (possibly larger)
<br /> MacOS X w/ HFS+ 2TB<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:191"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:192"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:65</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Give the syntax of Grant and Revoke commands? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:193"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:65</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">The generic syntax for grant is as following
<br /> > GRANT [rights] on [database/s] TO [username@hostname] IDENTIFIED BY
<br /> [password]
<br /> now rights can be
<br /> a) All privileges
<br /> b) combination of create, drop, select, insert, update and delete etc.We can grant rights on all databse by using *.* or some specific
<br /> database by database.* or a specific table by database.table_name
<br /> username@hotsname can be either username@localhost, username@hostname
<br /> and username@%
<br /> where hostname is any valid hostname and % represents any name, the *.*
<br /> any condition
<br /> password is simply the password of userThe generic syntax for revoke is as following
<br /> > REVOKE [rights] on [database/s] FROM [username@hostname]
<br /> now rights can be as explained above
<br /> a) All privileges
<br /> b) combination of create, drop, select, insert, update and delete etc.
<br /> username@hotsname can be either username@localhost, username@hostname
<br /> and username@%
<br /> where hostname is any valid hostname and % represents any name, the *.*
<br /> any condition<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:194"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:195"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:66</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Explain Normalization concept? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:196"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:66</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">The normalization process involves getting our data to conform to
<br /> three progressive normal forms, and a higher level of normalization
<br /> cannot be achieved until the previous levels have been achieved (there
<br /> are actually five normal forms, but the last two are mainly academic and
<br /> will not be discussed).First Normal FormThe First Normal Form (or 1NF) involves removal of redundant data
<br /> from horizontal rows. We want to ensure that there is no duplication of
<br /> data in a given row, and that every column stores the least amount of
<br /> information possible (making the field atomic).Second Normal FormWhere the First Normal Form deals with redundancy of data across a
<br /> horizontal row, Second Normal Form (or 2NF) deals with redundancy of
<br /> data in vertical columns. As stated earlier, the normal forms are
<br /> progressive, so to achieve Second Normal Form, your tables must already
<br /> be in First Normal Form.Third Normal Form <o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">I have a confession to make; I do not often use Third Normal Form. In
<br /> Third Normal Form we are looking for data in our tables that is not
<br /> fully dependant on the primary key, but dependant on another value in
<br /> the table<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:197"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:198"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:67</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we find the number of rows in a table using MySQL? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:199"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:67</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Use this for mysql
<br /> >SELECT COUNT(*) FROM table_name;<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:200"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:201"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:68</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we find the number of rows in a result set using PHP? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:202"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:68</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><code><span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">$result = mysql_query($sql, $db_link);</span></code><span style="font-family:"Calibri","sans-serif"; mso-bidi-font-family:"Courier New"">
<br /> </span><code><span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">$num_rows = mysql_num_rows($result);</span></code><span style="font-family:"Calibri","sans-serif"; mso-bidi-font-family:"Courier New"">
<br /> </span><code><span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">echo “$num_rows rows found”;</span></code><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:203"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:204"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:69</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How many ways we can we find the current date using MySQL? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:205"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:69</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">SELECT CURDATE();
<br /> CURRENT_DATE() = CURDATE()
<br /> for time use
<br /> SELECT CURTIME();
<br /> CURRENT_TIME() = CURTIME()<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:206"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:207"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:70</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What are the advantages and disadvantages of Cascading Style</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">Sheets? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:208"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:70</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">External Style SheetsAdvantagesCan control styles for multiple documents at once. Classes can be
<br /> created for use on multiple HTML element types in many documents.
<br /> Selector and grouping methods can be used to apply styles under complex
<br /> contextsDisadvantagesAn extra download is required to import style information for each
<br /> document The rendering of the document may be delayed until the external
<br /> style sheet is loaded Becomes slightly unwieldy for small quantities of
<br /> style definitionsEmbedded Style Sheets <o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">Advantages<o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">Classes can be created for use on multiple tag types in the document.
<br /> Selector and grouping methods can be used to apply styles under complex
<br /> contexts. No additional downloads necessary to receive style information<o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">Disadvantages<o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">This method can not control styles for multiple documents at once<o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">Inline Styles<o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">Advantages<o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">Useful for small quantities of style definitions. Can override other
<br /> style specification methods at the local level so only exceptions need
<br /> to be listed in conjunction with other style methods<o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">Disadvantages<o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">Does not distance style information from content (a main goal of
<br /> SGML/HTML). Can not control styles for multiple documents at once.
<br /> Author can not create or control classes of elements to control multiple
<br /> element types within the document. Selector grouping methods can not be
<br /> used to create complex element addressing scenarios<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:209"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:210"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:71</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What type of inheritance that PHP supports? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:211"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:71</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">In PHP an extended class is always dependent on a single base class,
<br /> that is, multiple inheritance is not supported. Classes are extended
<br /> using the keyword ‘extends’.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:212"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:213"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:72</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What is the difference between Primary Key and</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">Unique key? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:214"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:72</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Primary Key: A column in a table whose values uniquely identify the
<br /> rows in the table. A primary key value cannot be NULL. <o:p></o:p></span></p> <p><span style="font-family:"Calibri","sans-serif"">Unique Key: Unique Keys are used to uniquely identify each row in the
<br /> table. There can be one and only one row for each unique key value. So
<br /> NULL can be a unique key.There can be only one primary key for a table but there can be more
<br /> than one unique for a table.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:215"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:216"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif";background:#FFCC66">Q:73</span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal" style="margin-bottom:12.0pt"><strong><span style="font-family:"Calibri","sans-serif";background:#FFCC66">The structure of table view buyers is as follows:</span></strong><span style="font-family: "Calibri","sans-serif""><o:p></o:p></span></p> <table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="450" style="width:337.5pt;border-collapse:collapse;mso-padding-alt:.85pt .85pt .85pt .85pt"> <tbody><tr style="mso-yfti-irow:0;mso-yfti-firstrow:yes"> <td style="padding:.85pt .85pt .85pt .85pt"> <p class="MsoNormal" align="center" style="text-align:center"><strong><span style="font-family:"Calibri","sans-serif"">Field</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:.85pt .85pt .85pt .85pt"> <p class="MsoNormal" align="center" style="text-align:center"><strong><span style="font-family:"Calibri","sans-serif"">Type</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:.85pt .85pt .85pt .85pt"> <p class="MsoNormal" align="center" style="text-align:center"><strong><span style="font-family:"Calibri","sans-serif"">Null</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:.85pt .85pt .85pt .85pt"> <p class="MsoNormal" align="center" style="text-align:center"><strong><span style="font-family:"Calibri","sans-serif"">Key</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:.85pt .85pt .85pt .85pt"> <p class="MsoNormal" align="center" style="text-align:center"><strong><span style="font-family:"Calibri","sans-serif"">Default</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:.85pt .85pt .85pt .85pt"> <p class="MsoNormal" align="center" style="text-align:center"><strong><span style="font-family:"Calibri","sans-serif"">Extra</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:1"> <td style="padding:.85pt .85pt .85pt .85pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">user_pri_id<o:p></o:p></span></p> </td> <td style="padding:.85pt .85pt .85pt .85pt"> <p class="MsoNormal" style="text-align:justify"><span style="font-family: "Calibri","sans-serif"">int(15)<o:p></o:p></span></p> </td> <td style="padding:.85pt .85pt .85pt .85pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:.85pt .85pt .85pt .85pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">PRI<o:p></o:p></span></p> </td> <td style="padding:.85pt .85pt .85pt .85pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">null<o:p></o:p></span></p> </td> <td style="padding:.85pt .85pt .85pt .85pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">auto_increment<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:2;mso-yfti-lastrow:yes"> <td style="padding:.85pt .85pt .85pt .85pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">userid<o:p></o:p></span></p> </td> <td style="padding:.85pt .85pt .85pt .85pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">varchar(10)<o:p></o:p></span></p> </td> <td style="padding:.85pt .85pt .85pt .85pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">YES<o:p></o:p></span></p> </td> <td style="padding:.85pt .85pt .85pt .85pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:.85pt .85pt .85pt .85pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">null<o:p></o:p></span></p> </td> <td style="padding:.85pt .85pt .85pt .85pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> </tbody></table> <p><span style="font-family:"Calibri","sans-serif"">the value of user_pri_id the last row 999 then What will happen in
<br /> the following conditions?<o:p></o:p></span></p> <p><strong><span style="font-family:"Calibri","sans-serif"">Condition1</span></strong><span style="font-family:"Calibri","sans-serif"">: Delete all the rows and insert another row then.
<br /> What is the starting value for this auto incremented field user_pri_id ,
<br /> <strong><span style="font-family:"Calibri","sans-serif"">Condition2</span></strong>: Delete the last row(having the field value 999) and
<br /> insert another row then. What is the value for this auto incremented
<br /> field user_pri_id<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:217"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:73</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">In both cases let the value for auto increment field be n then next
<br /> row will have value n+1 i.e. 1000<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:218"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:219"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:74</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What are the advantages/disadvantages of MySQL and PHP? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:220"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:74</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Both of them are open source software (so free of cost), support
<br /> cross platform. php is faster then ASP and JSP.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:221"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:222"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:75</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What is the difference between GROUP BY and ORDER BY in Sql? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:223"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:75</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">ORDER BY [col1],[col2],…,[coln]; Tels DBMS according to what columns
<br /> it should sort the result. If two rows will hawe the same value in col1
<br /> it will try to sort them according to col2 and so on.GROUP BY
<br /> [col1],[col2],…,[coln]; Tels DBMS to group results with same value of
<br /> column col1. You can use COUNT(col1), SUM(col1), AVG(col1) with it, if
<br /> you want to count all items in group, sum all values or view average<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:224"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:225"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:76</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What is the difference between char and varchar data types? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:226"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:76</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Set char to occupy n bytes and it will take n bytes even if u r
<br /> storing a value of n-m bytes
<br /> Set varchar to occupy n bytes and it will take only the required space
<br /> and will not use the n bytes
<br /> eg. name char(15) will waste 10 bytes if we store ‘mizan’, if each char
<br /> takes a byte
<br /> eg. name varchar(15) will just use 5 bytes if we store ‘mizan’, if each
<br /> char takes a byte. rest 10 bytes will be free.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:227"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:228"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:77</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">What is the functionality of md5 function in PHP? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:229"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:77</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">Calculate the md5 hash of a string. The hash is a 32-character
<br /> hexadecimal number. I use it to generate keys which I use to identify
<br /> users etc. If I add random no techniques to it the md5 generated now
<br /> will be totally different for the same string I am using.<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:230"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:231"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:78</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can I load data from a text file into a table? </span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:232"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:78</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">you can use LOAD DATA INFILE file_name; syntax to load data
<br /> from a text file. but you have to make sure thata) data is delimited
<br /> b) columns and data matched correctly<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:233"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:234"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:79</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we know the number of days between two given dates using</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">MySQL? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:235"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:79</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">SELECT DATEDIFF(’2007-03-07</span><span style="font-family:"Verdana","sans-serif"">′</span><span style="font-family:"Calibri","sans-serif"">,’2005-01-01</span><span style="font-family:"Verdana","sans-serif"">′</span><span style="font-family: "Calibri","sans-serif"">);<o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:236"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:237"> <td width="34" valign="top" style="width:25.5pt;background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">Q:80</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="background:#FFCC66;padding:2.25pt 2.25pt 2.25pt 2.25pt"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">How can we know the number of days between two given dates using</span></strong><b><span style="font-family:"Calibri","sans-serif"">
<br /> <strong><span style="font-family:"Calibri","sans-serif"">PHP? </span></strong></span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> </tr> <tr style="mso-yfti-irow:238;mso-yfti-lastrow:yes;height:.25in"> <td width="34" valign="top" style="width:25.5pt;padding:2.25pt 2.25pt 2.25pt 2.25pt; height:.25in"> <p class="MsoNormal"><strong><span style="font-family:"Calibri","sans-serif"">A:80</span></strong><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> </td> <td style="padding:2.25pt 2.25pt 2.25pt 2.25pt;height:.25in"> <p class="MsoNormal"><span style="font-family:"Calibri","sans-serif"">$date1 = date(’Y-m-d’);
<br /> $date2 = ‘2006-08-15</span><span style="font-family:"Verdana","sans-serif"">′</span><span style="font-family:"Calibri","sans-serif"">;
<br /> $days = (strtotime($date1) - strtotime($date2)) / (60 * 60 * 24);<o:p></o:p></span></p> </td> </tr> </tbody></table> <p><span style="font-family:"Calibri","sans-serif""><o:p> </o:p></span></p> <span style="font-size:12.0pt;font-family:"Calibri","sans-serif";mso-fareast-font-family: "Times New Roman";mso-bidi-font-family:"Times New Roman";mso-ansi-language: EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA">
<br /> <ol start="1" type="1"> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">What does a special set of tags <?= and ?> do in PHP?</span></b><span style="font-family:"Calibri","sans-serif""> - The output is displayed directly to the browser. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">What’s the difference between include and require? - </span></b><span style="font-family:"Calibri","sans-serif"">It’s how they handle failures. If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what’s the problem?</span></b><span style="font-family:"Calibri","sans-serif""> - PHP Interpreter treats numbers beginning with 0 as octal. Look at the </span><a href="http://www.techinterviews.com/?p=174"><span style="font-family:"Calibri","sans-serif"">similar PHP interview questions</span></a><span style="font-family:"Calibri","sans-serif""> for more numeric problems. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars in this example?</span></b><span style="font-family:"Calibri","sans-serif""> - In this example it wouldn’t matter, since the variable is all by itself, but if you were to print something like "{$a},000,000 mln dollars", then you definitely need to use the braces. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">How do you define a constant?</span></b><span style="font-family:"Calibri","sans-serif""> - Via define() directive, like define ("MYCONSTANT", 100); <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">How do you pass a variable by value?</span></b><span style="font-family:"Calibri","sans-serif""> - Just like in C++, put an ampersand in front of it, like $a = &$b <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">Will comparison of string "10" and integer 11 work in PHP? </span></b><span style="font-family:"Calibri","sans-serif"">- Yes, internally PHP will cast everything to the integer type, so numbers 10 and 11 will be compared. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">When are you supposed to use endif to end the conditional statement?</span></b><span style="font-family:"Calibri","sans-serif""> - When the original if was followed by : and then the code block without braces. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">Explain the ternary conditional operator in PHP?</span></b><span style="font-family:"Calibri","sans-serif""> - Expression preceding the ? is evaluated, if it’s true, then the expression preceding the : is executed, otherwise, the expression following : is executed. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">How do I find out the number of parameters passed into function?</span></b><span style="font-family:"Calibri","sans-serif""> - func_num_args() function returns the number of parameters passed in. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of $$b?</span></b><span style="font-family:"Calibri","sans-serif""> - 100, it’s a reference to existing variable. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">What’s the difference between accessing a class method via -> and via ::?</span></b><span style="font-family:"Calibri","sans-serif""> - :: is allowed to access methods that can perform static operations, i.e. those, which do not require object initialization. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">Are objects passed by value or by reference?</span></b><span style="font-family:"Calibri","sans-serif""> - Everything is passed by value. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">How do you call a constructor for a parent class?</span></b><span style="font-family:"Calibri","sans-serif""> - parent::constructor($value) <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">What’s the special meaning of __sleep and __wakeup?</span></b><span style="font-family:"Calibri","sans-serif""> - __sleep returns the array of all the variables than need to be saved, while __wakeup retrieves them. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">Why doesn’t the following code print the newline properly?</span></b><span style="font-family:"Calibri","sans-serif""> <?php
<br /> $str = ‘Hello, there.\nHow are you?\nThanks for visiting TechInterviews’;
<br /> print $str;
<br /> ?>
<br /> Because inside the single quotes the \n character is not interpreted as newline, just as a sequence of two characters - \ and n. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">Would you initialize your strings with single quotes or double quotes?</span></b><span style="font-family:"Calibri","sans-serif""> - Since the data inside the single-quoted string is not parsed for variable substitution, it’s always a better idea speed-wise to initialize a string with single quotes, unless you specifically need variable substitution. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">How come the code <?php print "Contents: $arr[1]"; ?> works, but <?php print "Contents: $arr[1][2]"; ?> doesn’t for two-dimensional array of mine? - </span></b><span style="font-family:"Calibri","sans-serif"">Any time you have an array with more than one dimension, complex parsing syntax is required. print "Contents: {$arr[1][2]}" would’ve worked. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">What is the difference between characters \023 and \x23?</span></b><span style="font-family:"Calibri","sans-serif""> - The first one is octal 23, the second is hex 23. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">With a heredoc syntax, do I get variable substitution inside the heredoc contents?</span></b><span style="font-family:"Calibri","sans-serif""> - Yes. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">I want to combine two variables together:</span></b><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></li> </ol> </span><pre style="margin-left:.5in;text-indent:-.25in;mso-list:l1 level1 lfo3"><span style="font-size:12.0pt;font-family:"Calibri","sans-serif";mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri"><span style="mso-list:Ignore">22.<span style="font:7.0pt "Times New Roman""> </span></span></span><span style="font-size:12.0pt;font-family:"Calibri","sans-serif""><span style="mso-spacerun:yes"> </span>$var1 = 'Welcome to ';<o:p></o:p></span></pre><pre style="margin-left:.5in;text-indent:-.25in;mso-list:l1 level1 lfo3"><span style="font-size:12.0pt;font-family:"Calibri","sans-serif";mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri"><span style="mso-list:Ignore">23.<span style="font:7.0pt "Times New Roman""> </span></span></span><span style="font-size:12.0pt;font-family:"Calibri","sans-serif""><span style="mso-spacerun:yes"> </span>$var2 = 'TechInterviews.com';<o:p></o:p></span></pre> <p style="margin-left:.5in"><b><span style="font-family:"Calibri","sans-serif"">What will work faster? Code sample 1:</span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> <pre style="margin-left:.5in"><span style="font-size:12.0pt;font-family:"Calibri","sans-serif"">$var 3 = $var1.$var2;<o:p></o:p></span></pre> <p style="margin-left:.5in"><b><span style="font-family:"Calibri","sans-serif"">Or code sample 2:</span></b><span style="font-family:"Calibri","sans-serif""><o:p></o:p></span></p> <pre style="margin-left:.5in"><span style="font-size:12.0pt;font-family:"Calibri","sans-serif"">$var3 = "$var1$var2";<o:p></o:p></span></pre> <p style="margin-left:.5in"><span style="font-family:"Calibri","sans-serif"">Both examples would provide the same result - $var3 equal to "Welcome to TechInterviews.com". However, Code Sample 1 will work significantly faster. Try it out with large sets of data (or via concatenating small sets a million times or so), and you will see that concatenation works significantly faster than variable substitution. <o:p></o:p></span></p> <ol start="24" type="1"> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">For printing out strings, there are </span></b><a href="http://www.techinterviews.com/?s=echo&submit=Search"><b><span style="font-family:"Calibri","sans-serif"">echo</span></b></a><b><span style="font-family:"Calibri","sans-serif"">, </span></b><a href="http://www.techinterviews.com/?s=print&submit=Search"><b><span style="font-family:"Calibri","sans-serif"">print</span></b></a><b><span style="font-family:"Calibri","sans-serif""> and </span></b><a href="http://www.techinterviews.com/?s=printf"><b><span style="font-family: "Calibri","sans-serif"">printf</span></b></a><b><span style="font-family: "Calibri","sans-serif"">. Explain the differences</span></b><span style="font-family:"Calibri","sans-serif"">. - <b>echo</b> is the most primitive of them, and just outputs the contents following the construct to the screen. <b>print </b>is also a construct (so parentheses are optional when calling it), but it returns TRUE on successful output and FALSE if it was unable to print out the string. However, you can pass multiple parameters to <b>echo</b>, like: <o:p></o:p></span></li> </ol> <pre style="margin-left:.5in"><span style="font-size:12.0pt;font-family:"Calibri","sans-serif""><span style="mso-spacerun:yes"> </span><?php echo 'Welcome ', 'to', ' ', 'TechInterviews!'; ?><o:p></o:p></span></pre> <p style="margin-left:.5in"><span style="font-family:"Calibri","sans-serif"">and it will output the string "Welcome to TechInterviews!" <b>print</b> does not take multiple parameters. It is also generally argued that <b>echo </b>is faster, but usually the speed advantage is negligible, and might not be there for future versions of PHP. <b>printf </b> is a function, not a construct, and allows such advantages as formatted output, but it’s the slowest way to print out data out of <b>echo, print </b>and <b>printf</b>. <o:p></o:p></span></p> <ol start="25" type="1"> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">I am writing an application in PHP that outputs a printable version of driving directions. It contains some long sentences, and I am a neat freak, and would like to make sure that no line exceeds 50 characters. How do I accomplish that with PHP?</span></b><span style="font-family:"Calibri","sans-serif""> - On large strings that need to be formatted according to some length specifications, use </span><a href="http://us3.php.net/wordwrap"><span style="font-family:"Calibri","sans-serif"">wordwrap()</span></a><span style="font-family:"Calibri","sans-serif""> or </span><a href="http://us3.php.net/chunk_split"><span style="font-family:"Calibri","sans-serif"">chunk_split()</span></a><span style="font-family:"Calibri","sans-serif"">. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">What’s the output of the ucwords function in this example?</span></b><span style="font-family:"Calibri","sans-serif""> <o:p></o:p></span></li> </ol> <pre style="margin-left:.5in;text-indent:-.25in;mso-list:l1 level1 lfo3"><span style="font-size:12.0pt;font-family:"Calibri","sans-serif";mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri"><span style="mso-list:Ignore">27.<span style="font:7.0pt "Times New Roman""> </span></span></span><span style="font-size:12.0pt;font-family:"Calibri","sans-serif""><span style="mso-tab-count:1"> </span>$formatted = ucwords("TECHINTERVIEWS IS COLLECTION OF INTERVIEW QUESTIONS");<o:p></o:p></span></pre><pre style="margin-left:.5in"><span style="font-size:12.0pt;font-family:"Calibri","sans-serif""><span style="mso-tab-count:1"> </span>print $formatted;<o:p></o:p></span></pre> <p style="margin-left:.5in"><span style="font-family:"Calibri","sans-serif"">What will be printed is TECHINTERVIEWS IS COLLECTION OF INTERVIEW QUESTIONS.
<br /></span><a href="http://us3.php.net/manual/en/function.ucwords.php"><span style="font-family:"Calibri","sans-serif"">ucwords</span></a><span style="font-family:"Calibri","sans-serif"">() makes every first letter of every word capital, but it does not lower-case anything else. To avoid this, and get a properly formatted string, it’s worth using </span><a href="http://us2.php.net/strtolower"><span style="font-family:"Calibri","sans-serif"">strtolower</span></a><span style="font-family:"Calibri","sans-serif"">() first. <o:p></o:p></span></p> <ol start="28" type="1"> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">What’s the difference between </span></b><a href="http://us2.php.net/manual/en/function.htmlentities.php"><b><span style="font-family:"Calibri","sans-serif"">htmlentities</span></b></a><b><span style="font-family:"Calibri","sans-serif"">() and </span></b><a href="http://us2.php.net/manual/en/function.htmlspecialchars.php"><b><span style="font-family:"Calibri","sans-serif"">htmlspecialchars</span></b></a><b><span style="font-family:"Calibri","sans-serif"">()?</span></b><span style="font-family:"Calibri","sans-serif""> - htmlspecialchars only takes care of <, >, single quote ‘, double quote " and ampersand. htmlentities translates all occurrences of character sequences that have different meaning in HTML. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">What’s the difference between md5(), crc32() and sha1() crypto on PHP?</span></b><span style="font-family:"Calibri","sans-serif""> - The major difference is the length of the hash generated. CRC32 is, evidently, 32 bits, while sha1() returns a 128 bit value, and md5() returns a 160 bit value. This is important when avoiding collisions. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()?</span></b><span style="font-family:"Calibri","sans-serif""> - Crypto usage in PHP is simple, but that doesn’t mean it’s free. First off, depending on the data that you’re encrypting, you might have reasons to store a 32-bit value in the database instead of the 160-bit value to save on space. Second, the more secure the crypto is, the longer is the computation time to deliver the hash value. A high volume site might be significantly slowed down, if frequent md5() generation is required. <o:p></o:p></span></li> <li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo3;tab-stops:list .5in"><b><span style="font-family: "Calibri","sans-serif"">How do you match the character ^ at the beginning of the string?</span></b><span style="font-family:"Calibri","sans-serif""> - ^\^ <o:p></o:p></span></li> </ol> <p class="MsoNormal"><o:p> </o:p></p></div>mickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com0tag:blogger.com,1999:blog-2432773273760438764.post-58218672049930190582009-10-01T15:28:00.000+05:302009-10-01T15:35:19.011+05:30INTERVIEW QUESTIONS<div>PAPER 1:</div><div><br /></div><div>oops total:</div><div>inheritance</div><div>polymorphism</div><div>encapsulation</div><div>abstraction</div><div>data binding</div><div><br /></div><div><br /></div><div>2 what is subquery</div><div><br /></div><div>3 how we send email using js</div><div><br /></div><div>4 joomla (extra advantage)</div><div><br /></div><div>5. what is model view controller</div><div><br /></div><div>6. who is handle the business logic in cake php</div><div><br /></div><div>7 validation in cake php</div><div><br /></div><div>8 associations and parameters passed in asso</div><div><br /></div><div>9. where we put the third party js in cake php</div><div><br /></div><div>10 how we find the 2nd highest salary</div><div><br /></div><div>11 joins right join or left join</div><div><br /></div><div>12 write the 5 inbuilt functions of php</div><div><br /></div><div>13 make the two dynamic functions for send an email and connection to mysql</div><div><br /></div><div>14 example of inheritance</div><div><br /></div><div>15 how u start a cake project</div><div> (i) talk to client like this...</div><div><br /></div><div>16 component in cake php y we use this and how we use components in cake php</div><div><br /></div><div>17 what is helpers in cake php</div><div><br /></div><div>18 what is session </div><div><br /></div><div>19 how we destroy a session in cake php and a single var</div><div><br /></div><div>20 what is cookie </div><div><br /></div><div>21 why we use session</div><div><br /></div><div>22 thumbnails in cake php</div><div><br /></div><div>PAPER 2:</div><div><br /></div><div><div>Qus1:What is difference between require_once(), require(), include(). Becouse above three function usely use to call a file in another file.</div><div>ans:Difference between require() and require_once(): require() includes and evaluates a specific file, while require_once() does that only if it has not been included before (on the same page).</div><div>So, require_once() is recommended to use when you want to include a file where you have a lot of functions for example. This way you make sure you don't include the file more times and you will not get the "function re-declared" error.</div><div><br /></div><div>Difference between require() and include() is that require() produces a FATAL ERROR if the file you want to include is not found, while include() only produces a WARNING.</div><div><br /></div><div>There is also include_once() which is the same as include(), but the difference between them is the same as the difference between require() and require_once().</div><div><br /></div><div>Ques2:How to prevent form hijacking in PHP?</div><div>ans:Following things can be done for preventing your PHP Form from Hijacking</div><div><br /></div><div>1. Make register_globals to off to prevent Form Injection with malicious data.</div><div>2. Make Error_reporting to E_ALL so that all variables will be intialized before using them.</div><div>3. Make practice of using htmlentities(), strip_tags(), utf8_decode() and addslashes() for filtering malicious data in php</div><div>4. Make practice of using mysql_escape_string() in mysql.</div><div><br /></div><div>ans:Following are new features added in PHP5</div><div><br /></div><div>1. PHP 5 introduces the Standard PHP Library (SPL), which provides a number of ready-made classes and interfaces.</div><div>2. Access Modifiers are added in PHP5</div><div>3. PHP5 has built-in exception classes that makes it very easy to create your own customized exceptions through inheritance.</div><div>4. PHP 5 introduces the mysqli (MySQL Improved) extension with support for the features of MySQL databases versions 4.1 and higher. So use of prepare statements are allowed</div><div>5. PHP5 comes with PDO which is a common interface for different database systems is only made possible by the new object model.</div><div>6. SQLite is a database engine incorporated in php5 which can be used to develope faster, leaner and more versatile applications.</div><div>7. In PHP 5 all Extensible Markup Language (XML) support is provided by the libxml2 XML toolkit.</div><div>8. The reflection classes included in PHP 5 provide ways to introspect objects and reverse engineer code.</div><div>9. In addition to built-in classes, PHP 5 also offers built-in interfaces. Iterator is the most important, as a number of classes and interfaces are derived from this interface.</div><div>10. PHP 5 introduces a number of new "magic" methods. Magic methods begin with a double underscore, and this requires changing any user-defined methods or functions that use this naming convention.</div><div>11. The major change to PHP in version 5 relating to OOP is usually summed up by saying that objects are now passed by reference.</div><div><br /></div><div>ans:get_browser() attempts to determine the capabilities of the user's browser. This is done by looking up the browser's information in the browscap.ini file. </div><div><br /></div><div>echo $_SERVER['HTTP_USER_AGENT'] . "<hr /> ";</div><div><br /></div><div>$browser = get_browser();</div><div><br /></div><div>foreach ($browser as $name => $value) {</div><div>echo "<b>$name</b> $value<br />";</div><div>}</div><div><br /></div><div>//netsolutions questions...</div><div><br /></div><div>12. questions: sql: how u can get the nth record ?</div><div><br /></div><div><br /></div><div>13. how to have 3rd largest sal.?</div><div><br /></div><div>14. how to change content of 2nd sel box depending on 1st sel box in js</div><div><br /></div><div>or jquery?</div><div>ans. i d k</div><div><br /></div><div>ajax lagani padegi, meine yahi batya tha</div><div><br /></div><div><br /></div><div>15.how to change content of 2nd sel box depending on 1st sel box in js</div><div><br /></div><div>16.sql joins left join ka example</div><div><br /></div><div>17. php session and cookies</div><div><br /></div><div>18. php array sorting</div><div><br /></div><div>19. js split function</div><div><br /></div><div>20. cake php struct</div><div><br /></div><div>21. cakephp request handling</div><div><br /></div><div>22. session in cake</div><div><br /></div><div>23. sql indexes????</div><div><br /></div><div><br /></div><div><ol start="28" type="1"> </ol> <p class="MsoNormal"><o:p> </o:p></p></div></div>mickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com0tag:blogger.com,1999:blog-2432773273760438764.post-59929663641049977832009-04-24T10:53:00.000+05:302010-01-23T11:09:33.726+05:30naveen kumar<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_F-OEVqx5WTg/Sx-JIrgDukI/AAAAAAAAAC8/VQ_22gtUEPE/s1600-h/farm12.bmp"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://3.bp.blogspot.com/_F-OEVqx5WTg/Sx-JIrgDukI/AAAAAAAAAC8/VQ_22gtUEPE/s320/farm12.bmp" border="0" alt="" id="BLOGGER_PHOTO_ID_5413196059331770946" /></a><br />hi friends,<div>my name is naveen kumar. i am working on cakephp platform. </div><div>my form blog is <a href="http://prosolv.0fees.net/">http://prosolv.0fees.net/</a></div>mickyhttp://www.blogger.com/profile/17675928309112394063noreply@blogger.com1