tag:blogger.com,1999:blog-71176505477081861142024-03-13T12:41:00.889+08:00Learning PHPA blog how to learn about Personal Home Page (PHP)k_manhttp://www.blogger.com/profile/09803148173853887689noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-7117650547708186114.post-61503786360614743812010-01-29T12:11:00.015+08:002010-01-29T16:52:18.780+08:00Connecting to MySQL database<div style="font-family: Arial,Helvetica,sans-serif;">
<div style="text-align: justify;">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"></meta><meta content="Word.Document" name="ProgId"></meta><meta content="Microsoft Word 12" name="Generator"></meta><meta content="Microsoft Word 12" name="Originator"></meta><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" rel="File-List"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" rel="themeData"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" rel="colorSchemeMapping"></link><style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1073750139 0 0 159 0;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1593833729 1073750107 16 0 415 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin-top:0cm;
margin-right:0cm;
margin-bottom:10.0pt;
margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
font-size:10.0pt;
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
mso-ascii-font-family:Calibri;
mso-fareast-font-family:Calibri;
mso-hansi-font-family:Calibri;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style><span style="font-size: x-small;"><span style="font-family: Arial,Helvetica,sans-serif; line-height: 115%;">This tutorial will show you how to connect to
mysql database. It's easy to write a script to connect to world's most popular
opensource database.</span></span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<br /></div>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"></meta><meta content="Word.Document" name="ProgId"></meta><meta content="Microsoft Word 12" name="Generator"></meta><meta content="Microsoft Word 12" name="Originator"></meta><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" rel="File-List" style="font-family: Arial,Helvetica,sans-serif;"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" rel="themeData" style="font-family: Arial,Helvetica,sans-serif;"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" rel="colorSchemeMapping" style="font-family: Arial,Helvetica,sans-serif;"></link><style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1073750139 0 0 159 0;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1593833729 1073750107 16 0 415 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin-top:0cm;
margin-right:0cm;
margin-bottom:10.0pt;
margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
font-size:10.0pt;
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
mso-ascii-font-family:Calibri;
mso-fareast-font-family:Calibri;
mso-hansi-font-family:Calibri;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style><span style="font-size: x-small;"><span style="font-family: Arial,Helvetica,sans-serif; line-height: 115%;">Define your database information,</span></span><br />
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"></meta><meta content="Word.Document" name="ProgId"></meta><meta content="Microsoft Word 12" name="Generator"></meta><meta content="Microsoft Word 12" name="Originator"></meta><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" rel="File-List" style="font-family: Arial,Helvetica,sans-serif;"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" rel="themeData" style="font-family: Arial,Helvetica,sans-serif;"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" rel="colorSchemeMapping" style="font-family: Arial,Helvetica,sans-serif;"></link><style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1073750139 0 0 159 0;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1593833729 1073750107 16 0 415 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin-top:0cm;
margin-right:0cm;
margin-bottom:10.0pt;
margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
font-size:10.0pt;
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
mso-ascii-font-family:Calibri;
mso-fareast-font-family:Calibri;
mso-hansi-font-family:Calibri;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style><span style="font-size: x-small;"><span style="font-family: Arial,Helvetica,sans-serif; line-height: 115%;">* host="localhost" you don't have to
change it. When it's on your computer or server it still be localhost <br />
<br />
Username = admin<br />
Password = 1234<br />
Database = test </span><b style="font-family: Arial,Helvetica,sans-serif;"> </b></span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<br />
<b><span style="font-size: x-small;"><span style="font-family: Arial,Helvetica,sans-serif;">Test</span></span></b><b><span style="font-size: x-small;"><span style="font-family: Arial,Helvetica,sans-serif;"> </span></span></b></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/_rZlY-Jv0UJ4/S2KWZB-9BkI/AAAAAAAAADQ/MoqzwZvLKNo/s1600-h/sql.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="137" src="http://2.bp.blogspot.com/_rZlY-Jv0UJ4/S2KWZB-9BkI/AAAAAAAAADQ/MoqzwZvLKNo/s400/sql.jpg" width="400" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<span style="font-family: Arial,Helvetica,sans-serif; font-size: x-small;"><span style="line-height: 115%;"><b>Creating file
config.php</b> </span></span><br />
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/_rZlY-Jv0UJ4/S2KST1O2r1I/AAAAAAAAADI/9K8Dwob1gd0/s1600-h/sql1.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="221" src="http://2.bp.blogspot.com/_rZlY-Jv0UJ4/S2KST1O2r1I/AAAAAAAAADI/9K8Dwob1gd0/s400/sql1.jpg" width="400" /></a></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<div style="font-family: Arial,Helvetica,sans-serif;">
</div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<span style="font-size: x-small;"><b>Inserting data into mysql</b></span><span style="font-family: "Verdana","sans-serif"; font-size: x-small; line-height: 115%;"><b> </b></span><br />
<div style="font-family: Arial,Helvetica,sans-serif;">
<br /></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small; line-height: 115%;"><b>In this tutorial create 2 files</b><br />
1. insert.php<br />
2. insert_ac.php<br />
<br />
</span><span style="font-size: x-small; line-height: 115%;">
</span><meta content="text/html; charset=utf-8" http-equiv="Content-Type"></meta><meta content="Word.Document" name="ProgId"></meta><meta content="Microsoft Word 12" name="Generator"></meta><meta content="Microsoft Word 12" name="Originator"></meta><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" rel="File-List"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" rel="themeData"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" rel="colorSchemeMapping"></link><style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1073750139 0 0 159 0;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1593833729 1073750107 16 0 415 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin-top:0cm;
margin-right:0cm;
margin-bottom:10.0pt;
margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
font-size:10.0pt;
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
mso-ascii-font-family:Calibri;
mso-fareast-font-family:Calibri;
mso-hansi-font-family:Calibri;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style><span style="font-size: x-small; line-height: 115%;"><b>Step</b><br />
1. Create table "test_mysql" in database "test".<br />
2. Create file insert.php.<br />
3. Create file insert_ac.php.</span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;"><br /></span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"></meta><meta content="Word.Document" name="ProgId"></meta><meta content="Microsoft Word 12" name="Generator"></meta><meta content="Microsoft Word 12" name="Originator"></meta><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" rel="File-List"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" rel="themeData"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" rel="colorSchemeMapping"></link><style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1073750139 0 0 159 0;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1593833729 1073750107 16 0 415 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin-top:0cm;
margin-right:0cm;
margin-bottom:10.0pt;
margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
font-size:10.0pt;
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
mso-ascii-font-family:Calibri;
mso-fareast-font-family:Calibri;
mso-hansi-font-family:Calibri;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style><span style="font-size: x-small;"><b><span style="line-height: 115%;">Create table
"test_mysql"</span></b></span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;"></span></div>
<br />
<span style="color: blue; font-family: "Verdana","sans-serif"; font-size: x-small; line-height: 115%;">CREATE TABLE
`test_mysql` (</span><span style="color: blue; font-family: "Verdana","sans-serif"; font-size: x-small; line-height: 115%;"><br />
</span><span style="color: blue; font-family: "Verdana","sans-serif"; font-size: x-small; line-height: 115%;">`id` int(4) NOT NULL
auto_increment,</span><span style="color: blue; font-family: "Verdana","sans-serif"; font-size: x-small; line-height: 115%;"><br />
</span><span style="color: blue; font-family: "Verdana","sans-serif"; font-size: x-small; line-height: 115%;">`name` varchar(65) NOT NULL
default '',</span><span style="color: blue; font-family: "Verdana","sans-serif"; font-size: x-small; line-height: 115%;"><br />
</span><span style="color: blue; font-family: "Verdana","sans-serif"; font-size: x-small; line-height: 115%;">`lastname` varchar(65) NOT
NULL default '',</span><span style="color: blue; font-family: "Verdana","sans-serif"; font-size: x-small; line-height: 115%;"><br />
</span><span style="color: blue; font-family: "Verdana","sans-serif"; font-size: x-small; line-height: 115%;">`email` varchar(65) NOT
NULL default '',</span><span style="color: blue; font-family: "Verdana","sans-serif"; font-size: x-small; line-height: 115%;"><br />
</span><span style="color: blue; font-family: "Verdana","sans-serif"; font-size: x-small; line-height: 115%;">PRIMARY KEY (`id`)</span><span style="color: blue; font-family: "Verdana","sans-serif"; font-size: x-small; line-height: 115%;"><br />
</span><span style="color: blue; font-family: "Verdana","sans-serif"; font-size: x-small; line-height: 115%;">) TYPE=MyISAM
AUTO_INCREMENT=0 ;</span><span style="font-size: x-small;"><b style="font-family: Arial,Helvetica,sans-serif;"><span style="line-height: 115%;"> </span></b></span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/_rZlY-Jv0UJ4/S2KMk186v9I/AAAAAAAAACg/b47n7nr-4jQ/s1600-h/insert1.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/_rZlY-Jv0UJ4/S2KMk186v9I/AAAAAAAAACg/b47n7nr-4jQ/s320/insert1.jpg" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"></meta><meta content="Word.Document" name="ProgId"></meta><meta content="Microsoft Word 12" name="Generator"></meta><meta content="Microsoft Word 12" name="Originator"></meta><br />
<div style="text-align: left;">
</div>
<div style="font-family: Arial,Helvetica,sans-serif; text-align: left;">
<br />
<b><span style="font-size: 8.5pt; line-height: 115%;">Create file
insert.php</span></b></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-size: x-small;"><b> </b></span><a href="http://4.bp.blogspot.com/_rZlY-Jv0UJ4/S2KNfeFeYLI/AAAAAAAAACo/-vEcY_4bbXU/s1600-h/insert2.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/_rZlY-Jv0UJ4/S2KNfeFeYLI/AAAAAAAAACo/-vEcY_4bbXU/s320/insert2.jpg" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div style="font-family: Arial,Helvetica,sans-serif; text-align: left;">
</div>
<div style="font-family: Arial,Helvetica,sans-serif; text-align: left;">
<span style="font-size: x-small;"><b>Code</b></span></div>
<div style="text-align: left;">
<span style="font-size: x-small;"><b> </b></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: left;">
<span style="font-size: x-small;"><b> </b></span></div>
<div style="text-align: left;">
<span style="font-size: x-small;"><b> </b></span></div>
<div style="text-align: left;">
<span style="font-size: x-small;"><b> </b></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/_rZlY-Jv0UJ4/S2KZjaps_rI/AAAAAAAAADg/VuOjyJO9poA/s1600-h/insertcode1.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="361" src="http://2.bp.blogspot.com/_rZlY-Jv0UJ4/S2KZjaps_rI/AAAAAAAAADg/VuOjyJO9poA/s400/insertcode1.jpg" width="400" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"></meta><meta content="Word.Document" name="ProgId"></meta><meta content="Microsoft Word 12" name="Generator"></meta><meta content="Microsoft Word 12" name="Originator"></meta><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" rel="File-List"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" rel="themeData"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" rel="colorSchemeMapping"></link><style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1073750139 0 0 159 0;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1593833729 1073750107 16 0 415 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin-top:0cm;
margin-right:0cm;
margin-bottom:10.0pt;
margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
font-size:10.0pt;
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
mso-ascii-font-family:Calibri;
mso-fareast-font-family:Calibri;
mso-hansi-font-family:Calibri;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style><b><span style="font-size: x-small;"><span style="font-family: Arial,Helvetica,sans-serif;"><span style="line-height: 115%;">Create file
insert_ac.php</span></span></span></b><br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/_rZlY-Jv0UJ4/S2KcoGVodmI/AAAAAAAAADo/FnhGUzDkDy8/s1600-h/insert31.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="400" src="http://1.bp.blogspot.com/_rZlY-Jv0UJ4/S2KcoGVodmI/AAAAAAAAADo/FnhGUzDkDy8/s400/insert31.jpg" width="327" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br />
<br />
<div style="text-align: left;">
<span style="font-size: x-small;"><b>Code </b></span></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/_rZlY-Jv0UJ4/S2Kdf38Vs4I/AAAAAAAAAD4/5S5VPnk9xqI/s1600-h/insert32.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="400" src="http://1.bp.blogspot.com/_rZlY-Jv0UJ4/S2Kdf38Vs4I/AAAAAAAAAD4/5S5VPnk9xqI/s400/insert32.jpg" width="395" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<span style="font-size: x-small;"><b>Deleting data From mysql </b></span><br />
<span style="font-size: x-small;">Delete unwanted data from your mysql database.</span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;"><br /></span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">In this tutorial create 2 files</span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">1. delete.php</span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">2. delete_ac.php</span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;"><br /></span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">Step</span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">1. Create table "test_mysql" in database "test".</span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">2. Create file delete.php.</span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">3. Create file delete_ac.php.</span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;"><br /></span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">Set up database</span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;"><br /></span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">CREATE TABLE `test_mysql` (</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">`id` int(4) NOT NULL auto_increment,</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">`name` varchar(65) NOT NULL default '',</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">`lastname` varchar(65) NOT NULL default '',</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">`email` varchar(65) NOT NULL default '',</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">PRIMARY KEY (`id`)</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">) TYPE=MyISAM AUTO_INCREMENT=7 ;</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">--</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">-- Dumping data for table `test_mysql`</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">--</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">INSERT INTO `test_mysql` VALUES (1, 'Billly', 'Blueton', 'bb5@phpeasystep.com');</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">INSERT INTO `test_mysql` VALUES (2, 'Jame', 'Campbell', 'jame@somewhere.com');</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">INSERT INTO `test_mysql` VALUES (3, 'Mark', 'Jackson', 'mark@phpeasystep.com');</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">INSERT INTO `test_mysql` VALUES (4, 'Linda', 'Travor', 'lin65@phpeasystep.com');</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">INSERT INTO `test_mysql` VALUES (5, 'Joey', 'Ford', 'fordloi@somewhere.com');</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">INSERT INTO `test_mysql` VALUES (6, 'Sidney', 'Gibson', 'gibson@phpeasystep.com');</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/_rZlY-Jv0UJ4/S2JgfiZKjYI/AAAAAAAAACA/e7ItM-yeHxE/s1600-h/delete1.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/_rZlY-Jv0UJ4/S2JgfiZKjYI/AAAAAAAAACA/e7ItM-yeHxE/s320/delete1.jpg" /></a> </div>
<div class="separator" style="clear: both; text-align: left;">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"></meta><meta content="Word.Document" name="ProgId"></meta><meta content="Microsoft Word 12" name="Generator"></meta><meta content="Microsoft Word 12" name="Originator"></meta><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" rel="File-List"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" rel="themeData"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" rel="colorSchemeMapping"></link><style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1073750139 0 0 159 0;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1593833729 1073750107 16 0 415 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin-top:0cm;
margin-right:0cm;
margin-bottom:10.0pt;
margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
font-size:10.0pt;
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
mso-ascii-font-family:Calibri;
mso-fareast-font-family:Calibri;
mso-hansi-font-family:Calibri;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style><b><span style="font-family: Arial,Helvetica,sans-serif; font-size: x-small;"><span style="line-height: 115%;">Create file -
delete.php </span></span></b></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://1.bp.blogspot.com/_rZlY-Jv0UJ4/S2JhKOwImTI/AAAAAAAAACI/Q02XwLgI2ao/s1600-h/delete2.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/_rZlY-Jv0UJ4/S2JhKOwImTI/AAAAAAAAACI/Q02XwLgI2ao/s320/delete2.jpg" /></a></div>
<div class="separator" style="clear: both; font-family: Arial,Helvetica,sans-serif; text-align: left;">
<span style="font-size: x-small;"><b>Code</b></span></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<a href="http://4.bp.blogspot.com/_rZlY-Jv0UJ4/S2Kg9ratgjI/AAAAAAAAAEI/j2bKmxskwrs/s1600-h/del.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="http://4.bp.blogspot.com/_rZlY-Jv0UJ4/S2Kg9ratgjI/AAAAAAAAAEI/j2bKmxskwrs/s400/del.jpg" width="301" /></a><br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
<b><span style="font-family: "Verdana","sans-serif"; font-size: 8.5pt; line-height: 115%;">Create file
delete_ac.php</span></b></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; font-family: Arial,Helvetica,sans-serif; text-align: left;">
<span style="font-size: x-small;"><b><span style="line-height: 115%;">Code</span></b></span></div>
<div class="separator" style="clear: both; text-align: left;">
<b><span style="font-family: "Verdana","sans-serif"; font-size: 8.5pt; line-height: 115%;"> </span></b></div>
<div class="separator" style="clear: both; text-align: left;">
<b><span style="font-family: "Verdana","sans-serif"; font-size: 8.5pt; line-height: 115%;"> </span></b></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/_rZlY-Jv0UJ4/S2KfRrZXUyI/AAAAAAAAAEA/hHUBhj6Brj0/s1600-h/deleteac.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="400" src="http://2.bp.blogspot.com/_rZlY-Jv0UJ4/S2KfRrZXUyI/AAAAAAAAAEA/hHUBhj6Brj0/s400/deleteac.jpg" width="372" /></a></div>
<br />
<br />k_manhttp://www.blogger.com/profile/09803148173853887689noreply@blogger.com0tag:blogger.com,1999:blog-7117650547708186114.post-6091748831225819612010-01-27T16:37:00.016+08:002010-01-29T15:54:54.453+08:00Creating a simple PHP guestbook<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;"><b>Overview
In this tutorial create 3 files</b></span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">1. guestbook.php</span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">2. addguestbook.php</span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">3. viewguestbook.php</span></div>
<br />
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;"><b>Step</b></span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">1. Create table name "guestbook" in database "test".</span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">2. Create file guestbook.php.</span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">3. Create file addguestbook. php.</span></div>
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">4. Create file viewguestbook.php</span></div>
<br />
<br />
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;"><b>Set up database</b></span></div>
<br />
<a href="http://1.bp.blogspot.com/_rZlY-Jv0UJ4/S2JHXcEnRLI/AAAAAAAAAA4/9AH05PLnzAY/s1600-h/test.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="100" src="http://1.bp.blogspot.com/_rZlY-Jv0UJ4/S2JHXcEnRLI/AAAAAAAAAA4/9AH05PLnzAY/s400/test.jpg" width="400" /></a><br />
<br />
<br />
<br />
<br />
<br />
<br />
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">CREATE TABLE `guestbook` (</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">`id` int(4) NOT NULL auto_increment,</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">`name` varchar(65) NOT NULL default '',</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">`email` varchar(65) NOT NULL default '',</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">`comment` longtext NOT NULL,</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">`datetime` varchar(65) NOT NULL default '',</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">PRIMARY KEY (`id`)</span></div>
<div style="color: blue; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;</span></div>
<br />
<br />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"></meta><meta content="Word.Document" name="ProgId"></meta><meta content="Microsoft Word 12" name="Generator"></meta><meta content="Microsoft Word 12" name="Originator"></meta><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" rel="File-List"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" rel="themeData"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" rel="colorSchemeMapping"></link><style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1073750139 0 0 159 0;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1593833729 1073750107 16 0 415 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin-top:0cm;
margin-right:0cm;
margin-bottom:10.0pt;
margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
font-size:10.0pt;
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
mso-ascii-font-family:Calibri;
mso-fareast-font-family:Calibri;
mso-hansi-font-family:Calibri;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style><span style="font-size: x-small;"><b style="font-family: Arial,Helvetica,sans-serif;"><span style="line-height: 115%;">Create file
guestbook.php</span></b></span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/_rZlY-Jv0UJ4/S2JILlmpi7I/AAAAAAAAABA/zz_ARJ7XJ-Q/s1600-h/guestbook.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="203" src="http://4.bp.blogspot.com/_rZlY-Jv0UJ4/S2JILlmpi7I/AAAAAAAAABA/zz_ARJ7XJ-Q/s400/guestbook.jpg" width="400" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;"><b>Code</b></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/_rZlY-Jv0UJ4/S2JQKvHTN0I/AAAAAAAAABg/M9JqSkl7YDc/s1600-h/code.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="400" src="http://2.bp.blogspot.com/_rZlY-Jv0UJ4/S2JQKvHTN0I/AAAAAAAAABg/M9JqSkl7YDc/s400/code.jpg" width="375" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"></meta><meta content="Word.Document" name="ProgId"></meta><meta content="Microsoft Word 12" name="Generator"></meta><meta content="Microsoft Word 12" name="Originator"></meta><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" rel="File-List"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" rel="themeData"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" rel="colorSchemeMapping"></link><style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1073750139 0 0 159 0;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1593833729 1073750107 16 0 415 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin-top:0cm;
margin-right:0cm;
margin-bottom:10.0pt;
margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
font-size:10.0pt;
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
mso-ascii-font-family:Calibri;
mso-fareast-font-family:Calibri;
mso-hansi-font-family:Calibri;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style><b><span style="font-size: x-small;"><span style="font-family: Arial,Helvetica,sans-serif;"><span style="line-height: 115%;">create file
addguestbook.php</span></span></span></b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/_rZlY-Jv0UJ4/S2JMNn-2cII/AAAAAAAAABQ/TOdoLbg_URQ/s1600-h/test1.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="400" src="http://1.bp.blogspot.com/_rZlY-Jv0UJ4/S2JMNn-2cII/AAAAAAAAABQ/TOdoLbg_URQ/s400/test1.jpg" width="351" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div style="font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: x-small;">Code</span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/_rZlY-Jv0UJ4/S2JSwM0IWgI/AAAAAAAAABo/xoSragHq-AU/s1600-h/code1.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="315" src="http://1.bp.blogspot.com/_rZlY-Jv0UJ4/S2JSwM0IWgI/AAAAAAAAABo/xoSragHq-AU/s400/code1.jpg" width="400" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"></meta><meta content="Word.Document" name="ProgId"></meta><meta content="Microsoft Word 12" name="Generator"></meta><meta content="Microsoft Word 12" name="Originator"></meta><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" rel="File-List"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" rel="themeData"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" rel="colorSchemeMapping"></link><style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1073750139 0 0 159 0;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1593833729 1073750107 16 0 415 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin-top:0cm;
margin-right:0cm;
margin-bottom:10.0pt;
margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
font-size:10.0pt;
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
mso-ascii-font-family:Calibri;
mso-fareast-font-family:Calibri;
mso-hansi-font-family:Calibri;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style><span style="font-size: x-small;"><b style="font-family: Arial,Helvetica,sans-serif;"><span style="line-height: 115%;">Create file
viewguestbook.php</span></b></span><br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/_rZlY-Jv0UJ4/S2JMsnOfoBI/AAAAAAAAABY/MDGjHktcnRA/s1600-h/test2.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="400" src="http://2.bp.blogspot.com/_rZlY-Jv0UJ4/S2JMsnOfoBI/AAAAAAAAABY/MDGjHktcnRA/s400/test2.jpg" width="345" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div style="font-family: Arial,Helvetica,sans-serif;">
<b><span style="font-size: x-small;">Code</span></b></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/_rZlY-Jv0UJ4/S2JWmlN9BzI/AAAAAAAAABw/rMAef-O9TSU/s1600-h/code2.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="400" src="http://4.bp.blogspot.com/_rZlY-Jv0UJ4/S2JWmlN9BzI/AAAAAAAAABw/rMAef-O9TSU/s400/code2.jpg" width="392" /></a></div>
<br />
<br />k_manhttp://www.blogger.com/profile/09803148173853887689noreply@blogger.com0tag:blogger.com,1999:blog-7117650547708186114.post-26195370589129848122009-12-07T14:16:00.035+08:002010-01-27T16:34:58.702+08:00AppServ<div style="text-align: justify;">
<h1>
<span style="font-size: x-small;">What is PHP?</span></h1>
<div style="text-align: justify;">
<span style="font-size: x-small;">PHP, which stands for <b>"<i>H</i>ypertext <i>P</i>reprocessor"</b>, is a server-side, HTML embedded scripting language used to create dynamic Web pages. Much of its syntax is borrowed from C, Java and Perl with some unique features thrown in. The goal of the language is to allow Web developers to write dynamically generated pages quickly. In an HTML page, PHP code is enclosed within special PHP tags. When a visitor opens the page, the server processes the PHP code and then sends the output (not the PHP code itself) to the visitor's browser. It means that, unlike <a href="http://www.buildwebsite4u.com/advanced/javascript-code.shtml">JavaScript</a>, you don't have to worry that someone can steal your PHP script. PHP offers excellent connectivity to many databases including MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, and Generic ODBC. The popular PHP-MySQL combination (both are open-source products) is available on almost every UNIX host. Being web-oriented, PHP also contains all the functions to do things on the Internet - connecting to remote servers, checking email via POP3 or IMAP, url encoding, setting cookies, redirecting, etc. </span><br />
</div>
<div style="text-align: justify;">
<span style="font-size: x-small;"> </span><br />
<span style="font-size: x-small;"><b>What do PHP code look like?</b></span><br />
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
<span style="font-size: x-small;">PHP is a rather simple language. Much of its syntax is borrowed from C except for dealing with the types of variables. You don't need to think of the types of variables at all - you just work with their values, not their types. And you don't have to declare variables before you use them. </span><br />
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
<span style="font-size: x-small;"><b>Basic Syntax</b></span> <br />
</div>
<ul style="text-align: justify;">
<li><span style="font-size: x-small;">File name:<br />
You should save your file with the extension <b>.php</b> (earlier versions used the extensions .php3 and .phtml).</span></li>
<li><span style="font-size: x-small;">Comments:<br />
// <i>This comment extends to the end of the line.</i><br />
/* <i>This is<br />
a multi-line<br />
comment</i> */</span></li>
<li><span style="font-size: x-small;">Escaping from HTML:<br />
A PHP code block starts with "</span><span style="font-size: x-small;">". A PHP code block can be placed anywhere in the HTML document.</span></li>
<li><span style="font-size: x-small;">Instruction separation:<br />
Each separate instruction must end with a semicolon. The PHP closing tag (?>) also implies the end of the instruction. <br />
</span></li>
</ul>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"></meta><meta content="Word.Document" name="ProgId"></meta><meta content="Microsoft Word 12" name="Generator"></meta><meta content="Microsoft Word 12" name="Originator"></meta><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" rel="File-List"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" rel="themeData"></link><link href="file:///C:%5CUsers%5CUser%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" rel="colorSchemeMapping"></link><style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1073750139 0 0 159 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin-top:0cm;
margin-right:0cm;
margin-bottom:10.0pt;
margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
font-size:10.0pt;
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
mso-ascii-font-family:Calibri;
mso-fareast-font-family:Calibri;
mso-hansi-font-family:Calibri;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style> <br />
<h1>
<span style="font-size: x-small;"> </span><span style="font-size: x-small;">What Does MySQL Mean?</span></h1>
<div class="node">
<div class="content">
<span style="font-size: x-small;">MySQL is a type of database, and it is popular with several Content Management Systems and widely available. There are many types of databases, so you should make sure that the type of database offered by your host is compatible with the software you plan to use.</span> <br />
</div>
</div>
<br />
<span style="font-size: x-small;"><b>Installing Appserv on Windows</b></span> <br />
</div>
<div style="text-align: justify;">
<span style="font-size: x-small;">Installing Apache Web Server, php and MySQL individually on Windows is not easy task. Because it might takes long time time to make so many configurations to work well such as editing in .ini setting, httpd.conf and many services and extensions used by Apache, php and MySql.</span> <br />
</div>
<div style="text-align: justify;">
<span style="font-size: x-small;">Appserv includes Apache, php, MySQL and phpMyAdmin in one package and you can install in a minute without make any configuration.</span> <br />
</div>
<div style="text-align: justify;">
<span style="font-size: x-small;">Let’s get started.</span> <br />
</div>
<div style="text-align: justify;">
<ul>
<li><span style="font-size: x-small;">Check the version history from Appserv.</span></li>
<li><span style="font-size: x-small;">Download the latest stable released Appserv windows installer version from SourceForget.net.</span></li>
</ul>
</div>
<b><span style="font-size: x-small;">Installing Appserv</span></b> <br />
<div style="text-align: justify;">
<span style="font-size: x-small;">Run the Appserv setup (.exe) file which you downloaded.</span> <br />
</div>
<div style="text-align: justify;">
<span style="font-size: x-small;">Before you install Appserv package make sure that you stop IIS if you has installed IIS in your machine because only one web server can run in single machine.</span> <br />
</div>
<div style="text-align: justify;">
<ul>
<li><span style="font-size: x-small;">You’ll see Welcome Message, click ‘Next’</span></li>
<li><span style="font-size: x-small;">You’ll see License Agreement, click ‘Next’</span></li>
<li><span style="font-size: x-small;">Choose the installation directory, c:\appserv as default. Click “Next”.</span></li>
<li><span style="font-size: x-small;">Select the applications you wish to install, all of four services checked as default. Click ‘Next’.</span></li>
<li><span style="font-size: x-small;">Enter the Apache web server information. Normally, you can put whatever you want. In Web Server Name, you can put “www.example.com” or something like this. Administrator’s Email Address, put your email address or </span><a href="mailto:%E2%80%9Ck_man@example.com"><span style="font-size: x-small;">“k_man@example.com</span></a><span style="font-size: x-small;">”.</span></li>
<li><span style="font-size: x-small;">Enter password for Mysql root user, enter a password which is easier to remember when you login to mysql database as root.</span></li>
<li><span style="font-size: x-small;">You’ll see installation progress.</span></li>
<li><span style="font-size: x-small;">Start Apache web server and Mysql service. Click “Finished”.</span></li>
</ul>
</div>
<span style="font-size: x-small;">Source from: </span><a href="http://www.google.com/"><span style="font-size: x-small;">Google</span></a> <br />
k_manhttp://www.blogger.com/profile/09803148173853887689noreply@blogger.com1tag:blogger.com,1999:blog-7117650547708186114.post-2041230625287446462009-12-07T13:16:00.001+08:002009-12-31T16:46:41.147+08:00My Picture<div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/_rZlY-Jv0UJ4/SxyQA_UIomI/AAAAAAAAAAM/-1T5OtQMeCo/s1600-h/23032008603.gif" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5412359198862778978" src="http://2.bp.blogspot.com/_rZlY-Jv0UJ4/SxyQA_UIomI/AAAAAAAAAAM/-1T5OtQMeCo/s200/23032008603.gif" style="float: left; margin: 0px 10px 10px 0px;" /></a><br />
</div>k_manhttp://www.blogger.com/profile/09803148173853887689noreply@blogger.com0