tag:blogger.com,1999:blog-23670589923809765212024-03-13T09:46:35.030+05:00PhP MySql class room by e AsankAMake money without investing even a single penny. visit the our sponser's web site to learn about making money online. create your own blog with google and place google adds ..
come here to learn php & mysql..easankahttp://www.blogger.com/profile/01289657811913915219noreply@blogger.comBlogger14125tag:blogger.com,1999:blog-2367058992380976521.post-41061878313238194172011-04-01T11:41:00.000+06:002011-04-01T11:41:06.314+06:00Blogger: Dashboard<a href="http://www.blogger.com/home">Blogger: Dashboard</a>easankahttp://www.blogger.com/profile/01289657811913915219noreply@blogger.com0tag:blogger.com,1999:blog-2367058992380976521.post-11721907905943329512011-04-01T11:40:00.002+06:002011-04-01T11:51:07.188+06:00Zend Module folder auto laoding Bootstrap.php problemsome times we need enable modules folder under application on Zend
<br />usually the module folder contains controllers, models,views, forms folders and other common auto loading folders.
<br />
<br />however to create the module folder works correctly we have to do bit configuration changes to application.ini, and the modules/Bootstrap.php files.<div>
<br />changes to Application/config/application.ini
<br />
<br /></div><div>add the followoing two lines to the above file
<br />
<br /></div><div><span class="Apple-style-span" >resources.modules[] = ""
<br />resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"</span>
<br />
<br />
<br />then the files Bootstrap.php under the new module folder say you ceated module called admin in the following location i.e "application/modules/admin"
<br />
<br />so the Bootstrap.php is go to the above location as ".. admin/bootstrap.php
<br />
<br />your new Bootstrap.php should looks like below
<br />
<br /></div><div><div><span class="Apple-style-span" ><!--?php</font--></span></div><div><span class="Apple-style-span" ><span class="Apple-style-span" > </span></span></div><div><span class="Apple-style-span" ><span class="Apple-style-span" >class Admin_Bootstrap extends Zend_Application_Module_Bootstrap</span></span></div><div><span class="Apple-style-span" ><span class="Apple-style-span" >{</span></span></div><div><span class="Apple-style-span" ><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" > </span></span></span></div><div><span class="Apple-style-span" ><span class="Apple-style-span" >}</span></span></div></div><div><span class="Apple-style-span" ><span class="Apple-style-span" >
<br /></span></span></div><div><span class="Apple-style-span" >
<br /></span></div><div><span class="Apple-style-span" >not like
<br />
<br /><!--?php class Admin_Bootstrap extends Zend_Application_Bootstrap_Bootstrap { } ?--><div><span class="Apple-style-span" ><!--?php</font--></span></div><div><span class="Apple-style-span" ><span class="Apple-style-span" > </span></span></div><div><span class="Apple-style-span" ><span class="Apple-style-span" >class Admin_Bootstrap extends Zend_Application_<meta equiv="content-type" content="text/html; charset=utf-8">Bootstrap_Bootstrap</span></span></div><div><span class="Apple-style-span" ><span class="Apple-style-span" >{</span></span></div><div><span class="Apple-style-span" ><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" > </span></span></span></div><div><span class="Apple-style-span" ><span class="Apple-style-span" >}</span></span></div><span class="Apple-style-span" >
<br />
<br />
<br /></span></span></div>easankahttp://www.blogger.com/profile/01289657811913915219noreply@blogger.com0tag:blogger.com,1999:blog-2367058992380976521.post-46359011477082368932011-01-27T01:24:00.003+06:002011-01-27T01:29:20.121+06:00To Help MY brotherThe below text is My Brothers own written one. please read it and be kind enough to do whatever possible. <br /><br />thank you <br />AsankA<br /><br />මිනිස් ජිවිතය හරිම පුදුමාකාරය, විටක සතුට දොරේ ගලා යයි, විටක දුක් කරදර නිමක් නෑතිව පෑමිනෙයි.මගේ ජිවිතයෙත් මම සතුටින් කාලය ගතකල කාලයක් තිබුනා. හරිම සෑහෑල්ලුවෙන් මම ජීවිතය විදිමින් හිටියා. ඒත් කාලයා මගේ සතුට උදුරාගෙන එවෙනුවට කදුළුවල ඝනකම මට තිලිණ කලා. අද මම මේ ලියන හෑමදේම මට සටහන් කරන්නට තිබුනේ මීට හුග කලකට කලින්. මම මේ ගෑන සටහන තබන්නට සිතු සෑම මොහොතකම එය වෑලකී ගියා.<br /><br />එත් අද මේ සියල්ල පවසා ඔබේන් උපකාරයක් බලාපොරොත්තු වන තරමටම කාලයේ අදෘශ්යමාන හස්තයට මම නතුවෙලා.<br />යමක් කමක් තේරෙන කාලයක ඉදලා මගේ තිබුන හිනය උනේ රුපවහිනි සංස්කාරක වරයෙක් වෙන්න. මම හෙමින් හෙමින් විවිද කඩයිම් පසුකරමින් ජිවිතේ ඉදිරියට ගෙවාදමමින් සිටියා.ඒ අතර තුරදී මට ලංකාවෙ ප්රසිද්ද රෑපවාහීනි වැඩසටහන් ආයතනයකින් මගේ සිහින රැකියාවට කැදවීමක් ලැබුණා... මම ඉතාමත් ආශාවෙන් රෑකියවෙ නිරතවෙමින් තවදුරටත් රුපවාහිනී මාධ්ය පිලිබදව ඉගෙන ගත්තා. රුපවාහිනි අධ්යක්ෂනය, නිශ්පාදනය පිලිබදවත් මට ඉගෙන්ගන්න ලෑබුනා .. ඒ වගේම රූපවාහීණී වැඩසටහන් සහාය අධ්යක්ෂණයටත් අවස්ථාවන් ලැබුනා. නමුත් ඒ තනතුර හොබවන්නට මට අවස්ථාව ලැබුනේ එකම එක ඒකාන්ගික ටෙලි නාට්යයක පමණයි.. මේ කාලයෙදි තමයි මගේ ජිවිතේ සතුටින්ම ගතකරපු කාලය, ඒත් ඒ සතුට පෑවතුනේ ඉතාම කෙටි කාලයක් පමනයි ... මේ කාලය තමයි මගේ ජිවිතේටකනකොකා හඩන්න පටන් ගත්තේ.. මම දෑක්ක හෑම හීනයක්ම මගේ ඉදිරියේදීම බොදවෙලා සේදිලා ගියා.<br />හිටි හැටියෙම මගේ එක කනක ශ්රවනය දුර්වල උනා. ඒ එක්කම ටික දවසකින් එය සම්පුර්නයෙන්ම නෑසීගියා. එවගේම අනිත් කනෙත් ශ්රවනය දුර්වල වෙන්න පටන් ගත්තා. පළමු කනේ ශ්රවනය දුර්වල වෙන්න පටන් ගත් මොහොතේ සිටම අද දක්වාම වෛද්ය ප්රතිකාර සදහා යොමු උනා. නමුත් අවාසනාවට මගේ කන් දෙකේම ශ්රවණතත්වය පහල යාම නතරකරගන්නට බෑරි උනා. සියල්ල මෙසේ වෙද්දි මාස තුනක කාලයක් සදහා මට ශ්රවණාධාරකයක් බාවිතා කිරීමෙන් පිහිටක් ලබා ගත්තා. නමුත් තව තවත් මගේ කනට සම්බන්ධ ස්නයු දුර්වල වුනා. මගේ ඈසෙමින් තිබු එකම කනත් නෑසී ගියා(බිහිරිඋනා). මෙ සියල්ල සිදුවී දෑන් වසර එකහමාරක ටත් වඩා කාලයක් මම බිහිරි බව විදිමින් සිටිනවා. මේකාලය තුල මම ජිවිතේ දී වින්ද වේදනාව කියා නිම කරන්නට මට පුලුවන් කමක් නෑ.. . ගොඩක් වෙලාවට මගේ බ්ලොග් එකේ මම මගේ දුක කවි ලෙසින් පිට කලා.<br />මම කෙමෙන් කෙමෙන්න සමාජ ගතවිම අත්හරිනු ලෑබුවා. ගෙදර අය පවා යමක් මට පෑවසීමට ඈත්නම් කොලකෑලිවල ලියා දෙමින් අදටත් ..මා සමග සංනිවේදනය ගොඩනෑගිමට මහත්වු ප්රයත්නයක් දරමින් සිටිනවා.මම ගෙවාදෑමු මුසල කාලය පුරාවටම මම මගේ යහලුවන් ගෙදර අය සහ බොහෝ දෙනා සමග අදහස් හුවමරු කලේ කොල කෑලිවල ලියමින්. වෛද්ය වරුන්ගේ මතය වී ඈත්තේ තවත් අනපේක්ෂිත කාලයකින් මගේ කතා කිරිමත් නෑතිවනු ඈතිබවයි.<br />ජාතික රොහලේ උගුර කන නාසය පිලිබද ප්රධාන විශේෂඥ වෛද්ය ශාන්ත පෙරේරා යටතේ සෑත්කමක් කල අතර එයිනුත් කිසිම ප්රතිඵලයක් සිදුවුනේ නෑ ... නමුත් දෑන් මාහට ශ්රවනය නෑවත ලබා ගෑනීමටනම් කර්නශන්ඛ බද්යක් කලයුතු බව වෛද්ය නිගමනයයි. ඒසදහා අවශ්ය කරන උපකරනය ගෙන්වා ගෑනීම සදහා යන වියදම වු රුපියල් ලක්ශ 30(මිලියන 3) ක්වු විශාල වියදම මටවත් මගේ පවුලේ කිසිවෙකුටවත් දෑරිය නොහෑකි මුදලක්...<br />මගේ නෑදයනුත් මම මෙතෙක් කල් හම්බ කල මිතුරනුත් ඔවුනට හැකි ලෙසින් උදවු කිරීමට ඉදිරිපත් වෙමින් සිටිනවා. ජනාධිපති අරමුදලෙනුත් මුදලක් බලාපොරොත්තුවෙන් සිටින අතර මා සමග මගේ ‘ඉලන්දාරියා’බ්ලොග් අඩවිය සමගින් මා හා ඒකාත්මික වු වර්චවල් මිතුරන්ගෙනුත් හැකි උපකාරයක් බලාපොරොත්තුවෙන් මාගේ මේ සටහන තැබීමට සිතීමී. මා මෙවැනි සටහනක් තැබීමට කිසි දිනකත් නොසිතුවෙමි නොපැතුවෙමි. නමුත් මිනිසුන් අසරන වන්නේ නොපැතූ නොසීතු අවස්ථාවන් වලදීය. මාගේ බ්ලොග් අඩවිය තුලින් මා ගොඩක් හිතෛහී මිතුරන් හදුනා ගත්තා. වර්චුවල් අවකාශයෙන් තොර අවංක බැදීම් ඇති කර ගත්තා. සමහරුන් මා රෝහල් ගත වී සිටි කාලයේ මාගේ සුවදුක් විමසීමට පැමිණියා. වචනවලින් උවත් බ්ලොග් මිතුරන් මාව සෑහෙන දිරිමත් කලා. ඔවුනට අනේක වාරයක් ස්තූති. ඒ වර්වුල් මිතුරු කමවත් මට නොපැවතුනානම් මගේ ජීවිතය කිසිදු ශබ්දයක් නොමැති කලු වර කාමරයක තනිවුනා හා සමානයි මට වරෙක සිතෙයි.<br />ඉතින් මිතුරනේ මා හා ලැබැදිව සිටි ඔබගෙන් මා මේ උපකාරයක් බලාපොරොත්තු වන වෙලාවයි. ඔබට හැකියාවක් ඇතිනම් මට මගේ ආබාධය සුව කර ගැනීමට අත් වැලක් වෙන්න ඔබට අනේක වාරයක් ස්තුතියි. මේ සමග මගේ රෝගය හා ඒ සම්බන්ධ ලිපිද ඉදිරිපත් කරමි. <br />ස්තුතියි!.<br />විමසිම්<br />0772332071 <br />0718050116<br />D.M.D.T.B. දිසානායක<br />බෑංකු ගිනුම් අංක 71408612 <br />(ලංකා බෑංකුව මාතලේ )<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpRbtHUxPC0jrkbcqqnJgCLsK0nAsVYCVs-AHPOWI_QjOcEldB7QSKQ8zulslEyNNVC5_ehy_QMzj9bDtDfz56oUUueh_ttqC6JM6SPmzZtSaCBye7rvu5kiV5Se8KkeYwBYIggdvtmLI/s1600/cc001.jpg"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 224px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpRbtHUxPC0jrkbcqqnJgCLsK0nAsVYCVs-AHPOWI_QjOcEldB7QSKQ8zulslEyNNVC5_ehy_QMzj9bDtDfz56oUUueh_ttqC6JM6SPmzZtSaCBye7rvu5kiV5Se8KkeYwBYIggdvtmLI/s320/cc001.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5566578551109197506" /></a><br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDVvcHpgLgA8Xq3GNI1hVUFjEAHdDzsjghLV4dS7lmlJhyxy0XxzNXefb16BXrAZp96YAJL8cIW2mpkLESUGysXivP4YMO3aEQZJfrKs6sDH6g5HJu4Rzwy7CMEzw5_M6GJEBWfVpzKUI/s1600/cc002.jpg"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 223px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDVvcHpgLgA8Xq3GNI1hVUFjEAHdDzsjghLV4dS7lmlJhyxy0XxzNXefb16BXrAZp96YAJL8cIW2mpkLESUGysXivP4YMO3aEQZJfrKs6sDH6g5HJu4Rzwy7CMEzw5_M6GJEBWfVpzKUI/s320/cc002.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5566578548504465570" /></a><br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyr5VnCcpI4JbrcmEMpVFuBxzAgYs0Qlq4W4toF1rA3K435NftqREk3ek8ZclF0FpvfOR4fZEHS99wu_rqz9rLft6PKa80DkfdZOYCdhRzqk41XkAM49sQuLegiA2YPiXYaX1TD0dRLiQ/s1600/gg014.jpg"><br /><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 299px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyr5VnCcpI4JbrcmEMpVFuBxzAgYs0Qlq4W4toF1rA3K435NftqREk3ek8ZclF0FpvfOR4fZEHS99wu_rqz9rLft6PKa80DkfdZOYCdhRzqk41XkAM49sQuLegiA2YPiXYaX1TD0dRLiQ/s320/gg014.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5566578546378083074" /><br /><br /></a>easankahttp://www.blogger.com/profile/01289657811913915219noreply@blogger.com0tag:blogger.com,1999:blog-2367058992380976521.post-85892733210765934262010-08-03T17:42:00.000+06:002010-08-03T17:45:55.026+06:00Special kind of Sql Query on mysqlif(lastapp='AgentLogin','Agent Break',if( lastapp='Queue','Inbound Call',if(lastapp='Dial','Outbound Call',lastapp))) as lastappeasankahttp://www.blogger.com/profile/01289657811913915219noreply@blogger.com0tag:blogger.com,1999:blog-2367058992380976521.post-90782220125019557202010-02-10T22:30:00.011+06:002010-02-10T23:30:16.077+06:00වෙබ් පිටු දේශීයකරණය කිරීමවෙබ් යෙදුමක් හෝ අඩවියක භාශාව වෙනස් කිරීම ගැන තමයි අද අපි සලකා බලන්න හදන්නේ. අද නිදහස් මෘදුකාංග බොහෝමයක් නිර්මාණය වෙන්නේ මේ පහසුකමත් ඇතුලත් කරලා.. විශේෂයෙන්ම බොහෝමයක් වෙබ් යෙදුම් නිර්මාණය වෙන්නේ මේ පහසුකම සහිතවයි. ඊට හේතුව තමයි ඒවාට සමාජයේ උනන්දුවක් දක්වන වැඩි පිරිසගේ දායකත්වය ලැබෙන නිසා එය පහසුවෙන් තමන්ට අවශ්යය ආකාරයට සකසා ගැනීමට ඔවුනට පහසුව සැලසීම. මීට අමතරව එවන් හැකියාවක් තීබීම එම මෘදුකාංගය භාවිත කරන පිරිස වැඩි කරගැනීමටත් ඉවහල් වෙනවා..<br /><br />අද මම මේ පහසුකම වෙබ් යෙදුමක හෝ අඩවියක PHP භාවිත කර නිර්මාණය කරන හැටි සරල විදියට පෙන්නන්නයි ලැහැස්තිය..<br /><br />BELOW IS THE FOLDER STRUCTURE I'AM USING TO THIS WEB SITE<br /><br />/ - the_web_app<br /> |_ index.php<br /> |__ lang <folder><br /> |_english.php<br /> |_ sinhala.php<br /><br />lang/english.php ගොනුවේ තමයි අපි අදාල වෙබ් පිටුවේ දර්ශනය කිරීමට බලාපොරොත්තු වන ඉංග්රීසි භාශා වදන් තියෙන්නේ.<br />ඒ අයුරින්මයි සිංහල වදන් තිබෙන්නේ lang/sinhala.php ගොනුවේයි.<br /><br />පහතින් ඇත්තේ index.php ගොනුවේ කේතයි<br />-------------------------------------------------------------------------------------<br /></folder><?php<br /><br /> session_start();<br /><br /> $_SESSION['localization']['lang']= 'english';<br /> /// deaul language is english selected<br /><br /> if(isset($_POST['btnChangeLang'])){<br /> //if user selected to change lanuage<br /> $_SESSION['localization']['lang']= $_POST['cmbLang'];<br /> }<br /> require 'lang/'.$_SESSION['localization']['lang'] .'php';<br /><br />?><br /><br /><html><br /><head><br /><title>Application localization sample</title><br /></head><br /><body><br /><form name="frm1" method="post" action="index.php"><br /><table width="60"><br /> <tr><br /> <td colspan="2"><?php echo($APP_STRINGS['lang_opt']['display']);?></td><br /> </tr><br /> <tr><br /> <td width="20"><br /> <select name="cmbLang" id="cmblang" ><br /> <option value="sinhala"><?php echo($APP_STRINGS['lang_opt']['select_opt']['sinhala']); ?></option><br /> <option value="english"> <?php echo($APP_STRINGS['lang_opt']['select_opt']['english']); ?> </option><br /> </select><br /> </td><br /> <td width="40"><br /> <input type="submit" value="<?php echo($APP_STRINGS['lang_opt']['button']); ?>" id="btnChangeLang" name="btnChangeLang" /><br /> </td><br /> </tr><br /></table><br /></form><br /></body><br /></html><br /><br /><folder>-----------------------------------------------------------------------------------------------<br />lang/english.php<br /><br /></folder><<folder>?php<br /><br />$APP_STRING['lang_opt']= array(<br /><br /> "button"=</folder>><folder>"Change Language",<br /> "select_opt"=</folder>><folder> array("sinhala"=</folder>><folder>"Sinhala","english"=</folder>><folder>"English"),<br /> "display"=</folder>><folder>"Select a Language option and hit '\"Change Language\" button "<br />);<br /><br />?</folder>><br /><br />------------------------------------------------------------------------------------------------<br /><folder>sinhala.php<br /><br /><br /><?php<br /><br />$APP_STRING['lang_opt']= array(<br /><br /> "button"=</folder>><folder>"භාශාව වෙනස් කරන්න",<br /> "select_opt"=</folder>><folder> array("sinhala"=</folder>><folder>"සිංහල","english"=</folder>><folder>"ඉංග්රීසි"),<br /> "display"=</folder>><folder>"මුලින් භාශා විකල්පය තෝරා '\"</folder>භාශාව වෙනස් කරන්න<folder>\" බොත්තම ඔබන්න "<br />);<br /><br />?><br />------------------------------------------------------------------------------------------------<br /></folder>easankahttp://www.blogger.com/profile/01289657811913915219noreply@blogger.com2tag:blogger.com,1999:blog-2367058992380976521.post-50286763485458935952009-08-01T10:55:00.011+06:002011-07-27T18:51:13.610+06:00Make Connections to Mysql Databaseආයුබෝවන් වාසනාවන් !!!<br /><br />අද මට හිතුනා සිංහලෙන් ලියන්න කියලා. අපි අද ඉඳලා බලන්න හදන්නේ, කොහොමද <span style="font-weight: bold;">mysql</span> දත්ත ගබඩාවක අපිට ඕනෑ කරන ආකාරයට දත්ත සකසන්නේ කියලා. ඒ ඔක්කෝටම කලින් අපි අද බලමු <span style="font-weight: bold;">mysql </span>දත්ත ගබඩාවකට වෙබ් පිටුවක ඉඳලා <a name='more'></a>සම්බන්ධතාවයක් ඇති කර ගන්න ආකාරය.<br /><br />මෙ පහතින් පෙනෙන විදයට තමයි අපි ලියන්න ඕන.<br /><br />$connection = <span style="color: rgb(51, 102, 255);">mysql_connect</span>(<span style="color: rgb(255, 0, 0);">"hostame"</span>, <span style="color: rgb(255, 0, 0);">"Username"</span>, <span style="color: rgb(255, 0, 0);">"Password"</span>);<br /><br />මෙතනදි, <span style="font-weight: bold; color: rgb(255, 0, 0);">hostame</span> එක කියන්නේ අපි සම්බන්ධ වෙන්න යන <span style="font-weight: bold;">mysql</span> දත්ත ගබඩාව ස්ථාපනය කරලා තියෙන පරිගණකයේ නම , එහෙමත් නැතිනම් පරිගණකයට ආදේශ කර ඇති <span style="font-weight: bold;">IP</span> ලිපිනය ලබාදෙන්න පුළුවන්.<br /><br />ඊ ලඟට <span style="color: rgb(255, 0, 0);"><span style="font-weight: bold;">Username</span> </span>කියන්නේ දත්ත ගබඩාවට පිවිදීම සඳහා අවසර සහිත පරිශීලක ගේ නම.<br /><span style="color: rgb(255, 0, 0); font-weight: bold;">Password </span>ලෙස හඳුන් වන්නේ පරිශීලක හඳුනා ගැනීමට භාවිත කරන රහස්යය පදය හෙවත් මුර පදය යි.<br /><br />මෙම <span style="color: rgb(51, 102, 255);">mysql_connect </span>මඟින් අපිට අවශ්යය සම්බන්ධතාවය ගොඩ නංවා දෙනවා. ඉන් අනතුරුව අපට අවැසි ඕනෑම ආකරයකට දත්ත ගබඩාව පිරික්සන්න හැක් වෙනවා. මෙමඟින් ඇත්තටම අපිට ලැබෙන්නේ දත්ත ගබඩා සෙවාව හා ගොඩ නැඟෙන සම්බන්ධයක් පමණයි. ඒ නිසා මී ලඟට අපිට සිද්ධ වෙනවා අපිට අවශ්යය වන දත්ත සංචිත කර ඇති මූලය තොරා ගැනීමක් කරන්න. එයට හේතුව තමයි එක් දත්ත ගබඩා සෙවාවක් මඟින් දත්ත මූක කිහිපයක්ම හැසිරවීම. ඒ නිසා අපි දත්ත ගබඩා සෙවාවට දන්වන්න ඕන කුමන මූලයද අපි දැන භාවිතයට ගන්නේ කියලා.<br /><br />ඒ සදහා අපි පහත විධානය ලබා දිය යුතු වෙනවා.<br /><br /><span style="color: rgb(51, 102, 255);"><span style="color: rgb(0, 0, 0);">$link</span> = mysql_select_db</span>(<span style="color: rgb(255, 0, 0);">"testDb",</span>$connection);<br /><br />දැන් අපි දත්ත පිරික්සීමට සැරසෙන්නේ මෙම <span style="color: rgb(255, 0, 0); font-weight: bold;">testDb</span> නම් දත්ත මුලය තුලයි.<br />මින් අනතුරුව තමයි ඇත්තටම අපිට දත්ත සෙවීම හෝ ඇතුළු කිරීමට හැකි වෙන්නේ.<br /><br /><br />දැන් ඉතා සරල ක්රියාකාරකමක් අත්හදා බලමු.<br /><br />අපි අපේ <span style="font-weight: bold;">FRIENDS</span> දත්ත වගුවෙන් එහි සිටින සියළුම යහළුවන්ගේ නාම ලැයිස්තුවක් අර ගන්න හැටි බලමු. ඒ සඳහා ඒ බව අපි අපේ සේවා සැපයුමට ඉල්ලීමක් කරන්නේ පහත ආකාරයේ වැකියක් මඟිනි.<br /><br />එනම්: <span style="font-weight: bold;">SELECT firstName, lastName, eMail FROM FRIENDS</span><br /><br />PHP වෙබ් පිටුවේ ඉඳන් අපි මේ ඉල්ලීම කරන්නේ මේ විදියටයි<br /><br />එනම්: $result = <span style="color: rgb(51, 102, 255);">mysql_query</span>(<span style="color: rgb(255, 0, 0);">"SELECT firstName, lastName, eMail FROM FRIENDS"</span>);<br /><br />මෙමඟින් අපට අපි ඉල්ලපු යහළුවන්ගේ නාම ලැයිස්තුව ප්රථිපලයක් විදියට ලැබෙනවා. ඒ ලැයිස්තුව ඊලඟට අපි වෙබ් පිටුවේ පෙන්නන්නේ මේ විදිහටයි.<br /><br />$output= "";<br />while($row=mysql_fetch_array($result))<br />{<br /> $output .= "";}<br /><table style="width: 679px; height: 158px;"><tbody><tr><td>$row['<span style="color: rgb(255, 0, 0);">firstName</span>'] $row['<span style="color: rgb(255, 0, 0);">lastName</span>']</td><td> And Email: $row['<span style="color: rgb(255, 0, 0);">eMail </span>']</td></tr></tbody> </table>easankahttp://www.blogger.com/profile/01289657811913915219noreply@blogger.com0tag:blogger.com,1999:blog-2367058992380976521.post-35097969542639948062009-07-16T17:03:00.010+06:002009-08-01T10:49:30.794+06:00How to write Switch Case statement in PHPHI all,<br /><br />Here we can today learn how we could write a switch case construct in php. You know this statement we called it as conditional structure. that means this <span style="color: rgb(0, 153, 0);">switch</span> is used to do something if conditions provided are satisfied. this is basically equal to the <span style="color: rgb(51, 102, 255);">if - else if - else</span> statement.<br /><br />here is the syntax for the Switch statment;<br /><br />switch($var)<br />{<br /> case "1":<br /> echo"it is one";<br /> break;<br /> case "2":<br /> echo"it is Two";<br /> break;<br /> case "3":<br /> echo"it is Three";<br /> break;<br /> default:<br /> echo "defaul Value ";<br /> break;<br />}<br /><br /><br />easankahttp://www.blogger.com/profile/01289657811913915219noreply@blogger.com0tag:blogger.com,1999:blog-2367058992380976521.post-79776300733675738712009-05-05T23:53:00.009+06:002009-05-06T00:26:31.583+06:00Loop constructs in PHPhello Dear,<br /><br />Firs sorry for waiting long time to post this since my last post. I was having lot of works to complete in last few days. herewith today we gonna look at loops in php<br /><br />as in other languages php has loop/iterative construct. those loop construct are<br /><ul><li> for<br /></li><li>while</li><li>do .. while</li><li>foreach</li></ul>here is the sample for each of the above loops.<br /> <br /><span style="font-weight: bold;">for loop ..</span><br /><br /><span style="color: rgb(0, 153, 0);">for</span>($i=<span style="color: rgb(255, 0, 0);">0</span>; $i < <span style="color: rgb(255, 0, 0);">10</span>; $i<span style="color: rgb(0, 0, 153);">++</span>)<br />{<br /> <span style="color: rgb(0, 0, 153);">echo </span>($i .<span style="color: rgb(255, 0, 0);"> '< br />'</span>);<br />}<br /><br />//----------------------------------------------<br /><br /><span style="font-weight: bold;">While Loop</span><br /><br /><span style="color: rgb(0, 153, 0);">while</span>($row=<span style="color: rgb(0, 0, 153);">mysql_fetch_array</span>($result))<br />{<br /><br /> <span style="color: rgb(0, 0, 153);">echo</span> ($row[<span style="color: rgb(255, 0, 0);">0</span>] .<span style="color: rgb(255, 0, 0);"> "</span><span style="color: rgb(255, 0, 0);">< br /></span><span style="color: rgb(255, 0, 0);">"</span>);<br /><br />}<br /><br />//----------------------------------------------<br /><br /><span style="font-weight: bold;">Do While loop</span><br /><br />$i=<span style="color: rgb(255, 0, 0);">0</span>;<br /><span style="color: rgb(0, 153, 0);">do </span><br />{<br /> $i<span style="color: rgb(0, 0, 153);">++</span>;<br /><br /> <span style="color: rgb(255, 0, 0);">echo</span> (<span style="color: rgb(255, 0, 0);">"the no is:"</span> . $i .<span style="color: rgb(255, 0, 0);"> "</span><span style="color: rgb(255, 0, 0);">< br /></span><span style="color: rgb(255, 0, 0);">"</span>);<br /><br />}<br /><span style="color: rgb(0, 153, 0);">while</span>($i<<span style="color: rgb(255, 0, 0);">5</span>);<br /><br /><br />//------------------------------------------------<br /><br /><span style="font-weight: bold;">foreach loop</span><br /><br />$persons= <span style="color: rgb(0, 0, 153);">array</span>(<span style="color: rgb(255, 0, 0);">"name"</span>=><span style="color: rgb(255, 0, 0);">"mcDonald"</span>,<span style="color: rgb(255, 0, 0);">"city"</span>=><span style="color: rgb(255, 0, 0);">"torento"</span>,<span style="color: rgb(255, 0, 0);">"country"</span>=><span style="color: rgb(255, 0, 0);">"USA"</span>);<br /><br /><span style="color: rgb(0, 153, 0);">foreach</span>($item=<span style="color: rgb(0, 0, 153);">keys</span>($persons ))<br />{<br /> <span style="color: rgb(0, 0, 153);">echo</span>($persons[ $item] . <span style="color: rgb(255, 0, 0);">"</span><span style="color: rgb(255, 0, 0);">< br /></span><span style="color: rgb(255, 0, 0);">"</span>);<br />}<br /><br />we will try the case statement in next lesson and i'll stop @ here thanks gys n gallseasankahttp://www.blogger.com/profile/01289657811913915219noreply@blogger.com0tag:blogger.com,1999:blog-2367058992380976521.post-39127440273841853452009-04-16T14:40:00.004+06:002009-04-16T15:06:20.629+06:00arrays in PHP<p>To day We will look @ arrays in php</p><br /><p>in PHP we can find two types of arrays that one is array that we usually used<br /><br />with numeric indexed, and another one is associative arrays. this type of arrays<br /><br />also behave as same as usuall arays we used to.. only difference is we can use alphanumeric key index.<br /><br /><br /><br />You can understand this with following example..</p><br /><p>normally array is key value paired .<br /><br /><br /><br /> ex1:<br /><br />[<span style="color: rgb(255, 0, 0);">0</span>] => <span style="color: rgb(255, 0, 0);">456</span><br /><br />[<span style="color: rgb(255, 0, 0);">1</span>] => <span style="color: rgb(255, 0, 0);">3456</span><br /><br />[<span style="color: rgb(255, 0, 0);">2</span>] => <span style="color: rgb(255, 0, 0);">566</span><br /><br />[<span style="color: rgb(255, 0, 0);">3</span>] => <span style="color: rgb(255, 0, 0);">70</span></p><br />-------------------------------------------<br /><p><br />ex 2:<br /><br /><br />[<span style="color: rgb(204, 0, 0);">"name"</span>] => <span style="color: rgb(255, 0, 0);">"Mc.Donald"</span><br /><br />[<span style="color: rgb(204, 0, 0);">"ID"</span>] => <span style="color: rgb(255, 0, 0);">1234567889</span><br /><br />[<span style="color: rgb(204, 0, 0);">"SSN"</span>] => <span style="color: rgb(255, 0, 0);">"239898K"</span><br /><br />[<span style="color: rgb(204, 0, 0);">"Country"</span>] => <span style="color: rgb(255, 0, 0);">"Australia"</span><br /><br />[<span style="color: rgb(204, 0, 0);">"age"</span>] => <span style="color: rgb(255, 0, 0);">45</span><br /><br /></p><br /><p>in first example array index keys are numeric values <em style="font-weight: bold;">{0,1,2,3}</em> but in example 2 it is an alphanumeric values <em style="font-weight: bold;">{name,ID,SSN,Country,age}</em><br /><br /> <br /><br /> <span style="font-weight: bold;">How can create and access the arrays in PHP</span><br /><br /> arrays can be created and accessed in normall way how we do in other languages only difference is we dont specify the type of the values that holds by the array<br /><br />see below example how we create array.</p><br /><p>$Marks=<span style="color: rgb(51, 204, 255);"> array</span>(<span style="color: rgb(255, 0, 0);">0</span>=><span style="color: rgb(255, 0, 0);">12</span>,<span style="color: rgb(255, 0, 0);">1</span>=><span style="color: rgb(255, 0, 0);">34</span>,<span style="color: rgb(255, 0, 0);">2</span>=><span style="color: rgb(255, 0, 0);">50</span>,<span style="color: rgb(255, 0, 0);">3</span>=><span style="color: rgb(255, 0, 0);">60</span>,<span style="color: rgb(255, 0, 0);">4</span>=><span style="color: rgb(255, 0, 0);">45</span>); this array definition is also same as below definition..<br /><br /> $MarksII= <span style="color: rgb(51, 204, 255);">array</span>(<span style="color: rgb(255, 0, 0);">12</span>,<span style="color: rgb(255, 0, 0);">34</span>,<span style="color: rgb(255, 0, 0);">50</span>,<span style="color: rgb(255, 0, 0);">60</span>,<span style="color: rgb(255, 0, 0);">45</span>); // with this style index is autogenerated.<br /><br /><br /><br /> <span style="color: rgb(51, 102, 255);">echo</span> $Marks[<span style="color: rgb(255, 0, 0);">0</span>]; // output is 12<br /><br /><span style="color: rgb(51, 102, 255);">echo</span> $MarksII[<span style="color: rgb(255, 0, 0);">0</span>]; // output is 12 </p><br /><p>now we see ho we can create an associative array ..<br /><br />this is also same as normal array definition.<br /><br /><br /><br />$StudentsMarks =<span style="color: rgb(51, 204, 255);"> array</span>(<span style="color: rgb(204, 0, 0);">"kamal"</span>=><span style="color: rgb(255, 0, 0);">30</span>,<span style="color: rgb(204, 0, 0);">"amal"</span>=><span style="color: rgb(255, 0, 0);">34</span>,<span style="color: rgb(204, 0, 0);">"nimal"</span>=><span style="color: rgb(204, 0, 0);">50</span>,<span style="color: rgb(204, 0, 0);">"sunil"</span>=><span style="color: rgb(255, 0, 0);">20</span>); // this holds an marks of each stdents for a particular subject<br /><br />how we can print marks of a given student.<br /><br /><br /><br />echo $StudentsMarks[<span style="color: rgb(204, 0, 0);">"amal"</span>]; /// this wil echoes the marks of student amal. output is 34<br /><br />echo $StudentsMarks[<span style="color: rgb(204, 0, 0);">"sunil"</span>]; /// this wil echoes the marks of student sunil. output is 20<br /><br /><br /><br />when we working with array we have to loop through the array. how we can loop associative array<br /><br /> is like this...<br /><br /><br /><br /><span style="color: rgb(51, 102, 255);">foreach</span>($key=<span style="color: rgb(51, 102, 255);">key</span>($StudentsMarks))<br /><br />{<br /><br /> echo "marks of $key : $StudentsMarks[$key]<>";<br /><br /> <br />}</p><br /><p>this will prints an out put like below...<br /><br /> <br /><br /> marks of kamal : 30<br /><br /> marks of amal : 34<br /><br /> marks of nimal : 50<br /><br /> marks of sunil :20<br /><br /><br /><br /> i think you got some idea about arrays in PHP and im retain @ here.. we'll meet again with onother lesson<br /><br /> thank you..<br /><br /></p>easankahttp://www.blogger.com/profile/01289657811913915219noreply@blogger.com0tag:blogger.com,1999:blog-2367058992380976521.post-81083988257121566982009-04-04T11:41:00.000+06:002009-04-04T12:55:48.055+06:00PHP lesson II<strong>Hi all</strong> ,<br />Today we gonna have a look at data types and variable in PHP<br /><br />is there any data type in php? have you ever noticed that? like other programming languages we don't mention the data type of the variable wehen it declares huh..?<br />ex..<br />in C# ig we want an integer variable we declare it like this<br /><span style="color:#3333ff;">int</span> i=0;<br />but with PHP we dont mention it so. what we do is we simply use<br />$i=<span style="color:#ff0000;">0</span>;<br /><br />why we can do this, how php going to identify the type of the variable then.. does php has no data type ? we have to find answers fo these questions rite?<br /><br />the reason for this defference is "typing" what is typing means.. while other laguages use "strong type" php is gonna use "weekly type". basically in a higher level PHP has <span style="color:#3366ff;">scalar</span> type only. but behid the screen you can find couple of data type those are <span style="color:#3333ff;">integer,string,double. </span>PHP identifies the data type depending on the variable context.. you can see this with the following simple script<br /><span style="color:#ff0000;"><?php </span><span style="color:#000000;">$i=</span><span style="color:#ff0000;">10</span>; <span style="color:#cc9933;">// this will be integer type</span><br /><span style="color:#000000;">$f=</span><span style="color:#ff0000;">250.00</span>; <span style="color:#cc9933;">//this is a double</span><br /><span style="color:#000000;">$str=</span><span style="color:#cc0000;">"Hi i'm string";</span> <span style="color:#cc9933;">// this is string type</span><br /><span style="color:#000000;">$s=</span><span style="color:#cc0000;">'im too string '</span>; <span style="color:#cc9933;">// This is also a string</span><br /><span style="color:#000000;">$c=</span><span style="color:#cc0000;">'a'</span>; <span style="color:#cc9933;">// This is also a string<br /></span><br /><span style="color:#cc9933;">/*to see the data type of each variable we can use getType(); function*/</span><br /><br /><span style="color:#3366ff;">echo</span>( <span style="color:#3366ff;">getType</span>($i));<br /><span style="color:#3366ff;">echo</span> <span style="color:#cc0000;">"<br/>"; </span>;<br /><br /><span style="color:#3366ff;">echo</span>(<span style="color:#3366ff;">getType</span>($f));<br /><span style="color:#3366ff;">echo</span> "<br/>";<br /><br /><span style="color:#3366ff;">echo</span>( <span style="color:#3366ff;">getType</span>($str));<br /><span style="color:#3366ff;">echo</span> <span style="color:#cc0000;">"<br/>"; </span>;<br /><br /><span style="color:#3366ff;">echo</span>( <span style="color:#3366ff;">getType</span>($s));<br /><span style="color:#3366ff;">echo</span> <span style="color:#cc0000;">"<br/>"; </span>;<br /><br /><span style="color:#3366ff;">echo</span>(<span style="color:#3366ff;">getType</span>($c));<br /><span style="color:#3366ff;">echo</span> "<br/>";<br /><br /><span style="color:#ff0000;">?></span><br /></span><br />The out put will be like this<br />integer<br />double<br />string<br />string<br />string<br /><br />try this.. hope you got to know something new..<br />will meet with another lesson later<br />bye...<br /><br />:-)easankahttp://www.blogger.com/profile/01289657811913915219noreply@blogger.com0tag:blogger.com,1999:blog-2367058992380976521.post-91653372947907043272009-04-03T15:09:00.000+06:002009-04-03T15:17:58.261+06:00හිංගලෙන් ලියන්න හිතුනා<div style="text-align: center; font-weight: bold;">හිංගලෙන් කතා කරමු</div><br /><div style="text-align: left;">මට අද නිකමට හිතුනා මොනවා හරි සිංහලෙන් ලියන්න ඕන කයලා. ඉතින් ඔන්න ලිව්වා. ඔයාලා කාට හෝ අදසක් තියෙනවා නම් මේ අදහසට ප්රතිචාර එවන්න. සුදුසු මාතෘකාවක් අරන් අපි සංවාදයක් ගොඩ නගමු..<br /><br />එහෙනම් මම මෙතනින් නවතිනවා.. බොහෝම ස්තූතියි.<br /><br /></div>easankahttp://www.blogger.com/profile/01289657811913915219noreply@blogger.com1tag:blogger.com,1999:blog-2367058992380976521.post-25157202202111584582009-03-05T12:34:00.000+06:002009-03-05T13:47:19.363+06:00PHP: Simple hello world script<span style="font-weight: bold;">Starting with PHP</span><br /><br />here we going to write some simple PHP scripts to see how we can deveop a web page using PHP.<br /><br /> first of all , there should be a web Server installed in your computer so that we can browse for our web page. It is better if you have<span style="font-weight: bold;"> apache server installed</span> or else one of the server bundle from <span style="color: rgb(255, 153, 0);">XAMP </span>[this has for both windows and linux ],<span style="color: rgb(51, 51, 255);">WAMP</span> [for windows users],<span style="color: rgb(51, 204, 0);">LAMP</span> [linux users].<br />if you are a<span style="color: rgb(255, 102, 0);"> wi</span><span style="color: rgb(51, 255, 51);">nd</span><span style="color: rgb(51, 102, 255);">ow</span><span style="color: rgb(255, 255, 0);">s</span> user and already you have IIS installed then donload PHP binaries from www.php.net wich is official web site for PHP and install it in your computer ..<br /><br />After these step now we can sart development of our web pages with PHP. later appliations we can go to dance scripts even with db connections and web services, xml ,sockets, pdf, etc.. we may need some additional libraries to do programming in rlated to above mentioned things.. any way later with my applications im going to use mySql as my database serer. it is also a open source and free to download the free version and its better if u can download it and insatall it n your computer.<br /><br />seem that is enough for basic hre will star our web tutorial..<br /><br />first open up a text editor on your computer. we dont need any spacial IDE to do this exaple.. its really enough to have a saml text editor tool.<br /><br />the php scripts realy starts with <span style="color: rgb(255, 0, 0);"><?php</span> tag and it is end with <span style="color: rgb(255, 0, 0);">?></span>. actually what ever the php conent is gone within this tag. other wise it is not executed by the php engin/web server .<br /><br />see complete sample php file to our example.<br /><br /><span style="font-style: italic; font-weight: bold;">mytest1.php</span><br />---------------<br /><span style="color: rgb(0, 0, 102);"><html></span><br /><span style="color: rgb(0, 0, 102);"><head></span><br /><span style="color: rgb(0, 0, 102);"><title></span>PHP: Our sample Hello world application<span style="color: rgb(0, 0, 102);"></tittle></span><br /><span style="color: rgb(0, 0, 102);"></head></span><br /><span style="color: rgb(0, 0, 102);"><body></span><br /><span style="color: rgb(255, 0, 0);"><?php</span><br /><br /><span style="color: rgb(0, 0, 153);">echo</span> <span style="color: rgb(255, 0, 0);">"Hello : You are wel come to my web site"</span>;<br /> <span style="color: rgb(255, 204, 51);">// we are done, our first example</span><br /><br /><span style="color: rgb(255, 0, 0);">?></span><br /><span style="color: rgb(0, 0, 102);"></body></span><br /><span style="color: rgb(0, 0, 102);"></html></span><br /><br />This is one of the way that we can print string into the response web page. ther is onether way we an do this that is without including html tags. any way i dont recomend that way to use web pages except for the class files written in php.<br /><br />i.e :<br /><br /><span style="color: rgb(255, 0, 0);"><?php</span><br /><br /><span style="color: rgb(0, 0, 153);">echo</span> <span style="color: rgb(255, 0, 0);">"Hello : You are wel come to my web site"</span>;<br /> <span style="color: rgb(255, 204, 51);">// we are done, our first example</span><br /><br /><span style="color: rgb(255, 0, 0);">?></span><br /><br />ok, now we go to explanation above example.<br /><br /><span style="color: rgb(0, 0, 153);"> echo();</span> is the function that prints any out put to the page.<br /><br />you can see that the out put is enclosed within the double quatation marks <span style="color: rgb(255, 0, 0);">" "</span> this tells the server that this is the string which should be print onto the response. there is one of other way to do this. that is using the single quotation mark <br /><span style="color: rgb(255, 0, 0);">' '</span> see the following example.<br /><br />i.e<br /><span style="color: rgb(255, 0, 0);"><?php</span><br /><br /> <span style="color: rgb(0, 0, 153);">echo</span><br /> <span style="color: rgb(255, 0, 0);">' hello : You are wel come to my web site'</span>;<br /><span style="color: rgb(255, 204, 51);">// we are done, our first example</span><br /><br /><span style="color: rgb(255, 0, 0);">?<</span></span><br /><br />why there is two ways of doing this ? what is the difference between these two? guess..? actually it has difference. when you use single quot '' to echo something echo will print all the string same as it is appears to our eye. there is no limitation of escape character sequenes or som eother else.<br /><br />but if you are using double quot "" then the out put is change.. say you have some escape character within the double quat then echo will for sure escape those character and print he output..<br /><br />will learn those in next tutorial..<br />here lm gonna take a shower<br />thank you.<br />semiolon ( ; ) is the operator we used to tell that this is the end of the line.easankahttp://www.blogger.com/profile/01289657811913915219noreply@blogger.com0tag:blogger.com,1999:blog-2367058992380976521.post-90248590388075409092008-11-16T09:13:00.000+06:002008-11-16T09:15:26.644+06:00learn PHP MySqlhere we gonna teach you the php and mysql from the scratch. see the links below to get more php and mysql tutorials.easankahttp://www.blogger.com/profile/01289657811913915219noreply@blogger.com0tag:blogger.com,1999:blog-2367058992380976521.post-18233132680318361082008-10-29T09:56:00.000+06:002008-10-29T09:57:30.698+06:00hello all of you are welcome to my blogger.comeasankahttp://www.blogger.com/profile/01289657811913915219noreply@blogger.com0