<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Pagecity: Business Websites Development Guide</title>
	<link>http://www.pagecity.org</link>
	<description></description>
	<pubDate>Sun, 27 Apr 2008 20:52:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>
	<language>en</language>
			<item>
		<title>Ten days to learn PHP (10/10,pagecity.org)</title>
		<link>http://www.pagecity.org/news/ten-days-to-learn-php-1010pagecityorg_19/</link>
		<comments>http://www.pagecity.org/news/ten-days-to-learn-php-1010pagecityorg_19/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 20:52:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.pagecity.org/news/ten-days-to-learn-php-1010pagecityorg_19/</guid>
		<description><![CDATA[Study goal: The academic society uploads the document with PHP and sends the mail
The upload document form must add on enctype= &#8221; multipart/form-data &#8221;
With &#60;input type= &#8221; file &#8221; name= &#8221; file &#8221; &#62;
Below looks at the code:
$f=&#38;$HTTP_POST_FILES [&#8217;file&#8217;];
$dest_dir=&#8217;uploads&#8217;;//hypothesis upload table of contents
$dest=$dest_dir. &#8216;/&#8217; .date (“ymd”).”_ “. $f [&#8217;name&#8217;]; // my here establishes the document [...]]]></description>
			<content:encoded><![CDATA[<p>Study goal: The academic society uploads the document with PHP and sends the mail<br />
The upload document form must add on enctype= &#8221; multipart/form-data &#8221;<br />
With &lt;input type= &#8221; file &#8221; name= &#8221; file &#8221; &gt;<br />
Below looks at the code:<br />
$f=&amp;$HTTP_POST_FILES [&#8217;file&#8217;];<br />
$dest_dir=&#8217;uploads&#8217;;//hypothesis upload table of contents<br />
$dest=$dest_dir. &#8216;/&#8217; .date (“ymd”).”_ “. $f [&#8217;name&#8217;]; // my here establishes the document named date to add on the filename avoid repetition<br />
$r=move_uploaded_file ($f [&#8217;tmp_name&#8217;], $dest);<br />
chmod ($dest, 0755); // hypothesis upload document attribute<br />
Upload document named date (“ymd”).”_ “. $f [&#8217;name&#8217;], may will insert in later to database time use, PHP will in fact be the document which will upload you moves from the temporary table of contents to assigns the table of contents. move_uploaded_file ($f [&#8217;tmp_name&#8217;], $dest); This is a key<br />
As for sends the mail to be simpler, may use the mail() function<br />
mail (“addressee address”, “subject”, “main text”, “From: Addresser \ r \ nReply-to: Addresser&#8217;s address”);<br />
However mail() needs server&#8217;s support, also needs to dispose the SMTP server under WINDOWS, generally speaking the outside LINUX space is good.<br />
Probably the upload document and sends the mail to be simpler than many ASP, so long as the transfer function might. ASP also needs to use server&#8217;s different module for instance FSO, JMAIL anything.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pagecity.org/news/ten-days-to-learn-php-1010pagecityorg_19/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ten days to learn PHP (9/10)</title>
		<link>http://www.pagecity.org/news/ten-days-to-learn-php-910_18/</link>
		<comments>http://www.pagecity.org/news/ten-days-to-learn-php-910_18/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 20:51:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.pagecity.org/news/ten-days-to-learn-php-910_18/</guid>
		<description><![CDATA[Study goal: Matters needing attention
Because I am study ASP first, therefore makes PHP again time will discover that many places need to adapt.
1st, the attention do not leak the semicolon
2nd, before the attention do not leak the variable $
3rd, uses SESSION time pays attention do not omit session_start();
If occurs is wrong, may use the following [...]]]></description>
			<content:encoded><![CDATA[<p>Study goal: Matters needing attention</p>
<p>Because I am study ASP first, therefore makes PHP again time will discover that many places need to adapt.</p>
<p>1st, the attention do not leak the semicolon<br />
2nd, before the attention do not leak the variable $<br />
3rd, uses SESSION time pays attention do not omit session_start();</p>
<p>If occurs is wrong, may use the following methods:<br />
1st, if is the SQL sentence makes a mistake, then has output the SQL sentence on the annotation, the attention also wants the annotation to adjust the following execution SQL sentence<br />
2nd, if is the variable for spatial, mostly has not transmitted the arriving, the output variable inspects, inspects the form id and name<br />
3rd, if is the database connection makes a mistake, inspects whether to open MY SQL correctly and whether to omit the connection sentence<br />
4th, the attention shrinks, removes the mistake which the parenthesis area does not match</p>
<p>In makes the big website time, my mentality constructs the database first, determines each field the function, with table between relations. Then the design backstage contact surface, starts from the increase data to start, because increases whether to succeed may confirm directly to the database inside, completed the increase to make the demonstration again the page, finally was both&#8217;s union. Generally speaking the backstage includes the increase deletion to revise and to demonstrate that the backstage did not have the question, the onstage also did not have what major problem. The onstage also needs to pay attention to the security and fault-tolerant also has is the output format.</p>
<p>Good,  tomorrow will say, if will upload the document with PHP and sends the mail.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pagecity.org/news/ten-days-to-learn-php-910_18/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ten days to learn PHP (8/10)</title>
		<link>http://www.pagecity.org/news/ten-days-to-learn-php-810_17/</link>
		<comments>http://www.pagecity.org/news/ten-days-to-learn-php-810_17/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 20:50:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.pagecity.org/news/ten-days-to-learn-php-810_17/</guid>
		<description><![CDATA[Study goal: Makes a paging demonstration
The key was uses in SQL sentence limit to define the demonstration the record from several to several. We need a record current page variable $page, but also needs altogether record to count $num
Regarding $page, if does not have us to let its =0, if has &#60;0 to let its [...]]]></description>
			<content:encoded><![CDATA[<p>Study goal: Makes a paging demonstration</p>
<p>The key was uses in SQL sentence limit to define the demonstration the record from several to several. We need a record current page variable $page, but also needs altogether record to count $num</p>
<p>Regarding $page, if does not have us to let its =0, if has &lt;0 to let its also =0, if surpassed the total number of pages to let he = total number of pages.</p>
<p>$execc= &#8221; select count(*) from tablename “;<br />
$resultc=mysql_query($execc);<br />
$rsc=mysql_fetch_array($resultc);<br />
$num=$rsc[0];</p>
<p>This may obtain the record total<br />
ceil($num/10)), if page of 10 record, this is the total number of pages</p>
<p>Therefore may such write<br />
if (empty ($_GET [&#8217;page&#8217;]))<br />
{<br />
$page=0;<br />
}<br />
else<br />
{<br />
$page=$_GET [&#8217;page&#8217;];<br />
if($page&lt;0)$page=0;<br />
if($page&gt;=ceil($num/10))$page=ceil($num/10)-1; // because page is from 0 starts, therefore wants - 1<br />
}</p>
<p>Such $exec may such write $exec= &#8221; select * from tablename limit “. ($page*10).”, 10 &#8220;;<br />
a // page is 10 records</p>
<p>Finally we need to do are several connections:<br />
&lt;a href= &#8221; xxx.php? page=0 &#8221; &gt;FirstPage&lt;/a&gt;<br />
&lt;a href= &#8221; xxx.php? page=&lt;? = ($page-1)? &gt; &#8221; &gt;PrevPage&lt;/a&gt;<br />
&lt;a href= &#8221; xxx.php? page=&lt;? = ($page+1)? &gt; &#8221; &gt;NextPage&lt;/a&gt;<br />
&lt;a href= &#8221; xxx.php? page=&lt;? =ceil($num/10)-1? &gt; &#8221; &gt;LastPage&lt;/a&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pagecity.org/news/ten-days-to-learn-php-810_17/feed/</wfw:commentRss>
		</item>
		<item>
		<title>earn PHP and mysql programing:Step by step(7/10,pagecity.org)</title>
		<link>http://www.pagecity.org/news/earn-php-and-mysql-programingstep-by-step710pagecityorg_16/</link>
		<comments>http://www.pagecity.org/news/earn-php-and-mysql-programingstep-by-step710pagecityorg_16/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 20:48:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.pagecity.org/news/earn-php-and-mysql-programingstep-by-step710pagecityorg_16/</guid>
		<description><![CDATA[Learning Objective: To learn the use of SESSION
SESSION many of the role, with most of the site is within the pages of variable transmission. We must start the page session_start (); Open SESSION;
Then you can use SESSION variables, for example, is assigned to: $ _ SESSION [ &#8216;item&#8217;] = &#8220;item1&#8243;; need to get value is [...]]]></description>
			<content:encoded><![CDATA[<p>Learning Objective: To learn the use of SESSION</p>
<p>SESSION many of the role, with most of the site is within the pages of variable transmission. We must start the page session_start (); Open SESSION;<br />
Then you can use SESSION variables, for example, is assigned to: $ _ SESSION [ &#8216;item&#8217;] = &#8220;item1&#8243;; need to get value is $ item1 = $ _SESSION [ &#8216;item&#8217;];, it is very simple. Here, we may use some function, for instance, judgement is not a SESSION variable is empty, so to write: empty ($ _SESSION [ &#8216;inum&#8217;]) to return to true or false.</p>
<p>Below the front comprehensive look at what we have a landing procedures, judge the user password is correct.<br />
This form is landing: login.php<br />
&lt;table width=&#8221;100%&#8221; height=&#8221;100%&#8221; border=&#8221;0&#8243; align=&#8221;center&#8221; cellpadding=&#8221;0&#8243; cellspacing=&#8221;0&#8243;&gt;<br />
&lt;tr&gt;<br />
&lt;form action=&#8221;checklogin.php&#8221; method=&#8221;post&#8221;&gt; &lt;td align=&#8221;center&#8221; valign=&#8221;middle&#8221;&gt; &lt;table width = &#8220;400&#8243; border = &#8220;0&#8243; cellpadding = &#8220;5&#8243; cellspacing = &#8220;1&#8243; class = &#8220;tablebg&#8221;&gt;<br />
&lt;tr class=&#8221;tdbg&#8221;&gt;<br />
&lt;td colspan=&#8221;2&#8243;&gt; &lt;div align=&#8221;center&#8221;&gt; Administrators Login &lt;/ div&gt; &lt;/ td&gt;<br />
&lt;/ tr&gt;<br />
&lt;tr class=&#8221;tdbg&#8221;&gt;<br />
&lt;td&gt; &lt;div align=&#8221;center&#8221;&gt; Username &lt;/ div&gt; &lt;/ td&gt;<br />
&lt;td&gt; &lt;div align=&#8221;center&#8221;&gt;<br />
&lt;input name=&#8221;username&#8221; type=&#8221;text&#8221; id=&#8221;username&#8221;&gt;<br />
&lt;/ div&gt; &lt;/ td&gt;<br />
&lt;/ tr&gt;<br />
&lt;tr class=&#8221;tdbg&#8221;&gt;<br />
&lt;td&gt; &lt;div align=&#8221;center&#8221;&gt; Password &lt;/ div&gt; &lt;/ td&gt;<br />
&lt;td&gt; &lt;div align=&#8221;center&#8221;&gt;<br />
&lt;input name=&#8221;password&#8221; type=&#8221;password&#8221; id=&#8221;password&#8221;&gt;<br />
&lt;/ div&gt; &lt;/ td&gt;<br />
&lt;/ tr&gt;<br />
&lt;tr class=&#8221;tdbg&#8221;&gt;<br />
&lt;td colspan=&#8221;2&#8243;&gt; &lt;div align=&#8221;center&#8221;&gt;<br />
&lt;input type=&#8221;submit&#8221; name=&#8221;Submit&#8221; value=&#8221;Submit&#8221;&gt;<br />
&lt;input type=&#8221;reset&#8221; name=&#8221;Submit2&#8243; value=&#8221;Clear&#8221;&gt;<br />
&lt;/ div&gt; &lt;/ td&gt;<br />
&lt;/ tr&gt;<br />
&lt;/ table&gt; &lt;/ td&gt; &lt;/ form&gt;<br />
&lt;/ tr&gt;<br />
&lt;/ table&gt;</p>
<p>This is the processing of documents<br />
&lt; »<br />
require_once ( &#8216;conn.php&#8217;);<br />
session_start ();<br />
$ username = $ _POST [ &#8216;username&#8217;];<br />
$ password = $ _POST [ &#8216;password&#8217;];<br />
$ exec = &#8220;select * from admin where username =&#8217;&#8221;.$ username .&#8221;&#8216;&#8221;;<br />
if ($ result = mysql_query ($ exec))<br />
(<br />
if ($ rs = mysql_fetch_object ($ result))<br />
(<br />
if ($ rs-&gt; password == $ password)<br />
(<br />
$ _SESSION [ &#8216;Adminname&#8217;] = $ username;<br />
header ( &#8220;location: index.php&#8221;);<br />
)<br />
else<br />
(<br />
echo &#8220;&lt;script&gt; alert ( &#8216;Password Check Error!&#8217;); location.href = &#8216;login.php&#8217;; &lt;/ script&gt;&#8221;;<br />
)<br />
)<br />
else<br />
(<br />
echo &#8220;&lt;script&gt; alert ( &#8216;Username Check Error!&#8217;); location.href = &#8216;login.php&#8217;; &lt;/ script&gt;&#8221;;<br />
)<br />
)<br />
else<br />
(<br />
echo &#8220;&lt;script&gt; alert ( &#8216;Database Connection Error!&#8217;); location.href = &#8216;login.php&#8217;; &lt;/ script&gt;&#8221;;<br />
)<br />
«&gt;</p>
<p>conn.php is this:<br />
&lt; »<br />
$ conn = mysql_connect ( &#8220;127.0.0.1&#8243;, &#8220;&#8221;, &#8220;&#8221;);<br />
mysql_select_db ( &#8220;shop&#8221;);<br />
«&gt;</p>
<p>Because $ _ SESSION [ &#8216;adminname&#8217;] = $ username; written like this we can verify whether the documents landed statement: checkadmin.asp<br />
&lt; »<br />
session_start ();<br />
if ($ _SESSION [ &#8216;adminname&#8217;]==&#8221;)<br />
(<br />
echo &#8220;&lt;script&gt; alert ( &#8216;Please Login First&#8217;); location.href = &#8216;login.php&#8217;; &lt;/ script&gt;&#8221;;<br />
)<br />
?&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pagecity.org/news/earn-php-and-mysql-programingstep-by-step710pagecityorg_16/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Learn PHP and mysql programing:Step by step(6/10,pagecity.org)</title>
		<link>http://www.pagecity.org/news/learn-php-and-mysql-programingstep-by-step610pagecityorg_15/</link>
		<comments>http://www.pagecity.org/news/learn-php-and-mysql-programingstep-by-step610pagecityorg_15/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 20:48:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.pagecity.org/news/learn-php-and-mysql-programingstep-by-step610pagecityorg_15/</guid>
		<description><![CDATA[


Learning Objective: To learn to add amended to delete data
mysql_query ($ exec);
This statement alone can perform all the operations, is different this $ exec sql statement
Add: $ exec = &#8220;insert into tablename (item1, item2) values (&#8217;&#8221;.$_ POST [ &#8216;item1&#8242;].&#8221;&#8216;,&#8221;.$_ POST [&#8217; item1&#8242;].&#8221;)&#8221;;
Delete: $ exec = &#8220;delete from tablename where &#8230;&#8221;;
Laws: $ exec = &#8220;update tablename [...]]]></description>
			<content:encoded><![CDATA[<table id="texttable">
<tr valign="top">
<td class="almost_half_cell">
<p id="result_box" dir="ltr">Learning Objective: To learn to add amended to delete data<br />
mysql_query ($ exec);<br />
This statement alone can perform all the operations, is different this $ exec sql statement<br />
Add: $ exec = &#8220;insert into tablename (item1, item2) values (&#8217;&#8221;.$_ POST [ &#8216;item1&#8242;].&#8221;&#8216;,&#8221;.$_ POST [&#8217; item1&#8242;].&#8221;)&#8221;;<br />
Delete: $ exec = &#8220;delete from tablename where &#8230;&#8221;;<br />
Laws: $ exec = &#8220;update tablename set item1 =&#8217;&#8221;.$_ POST [ &#8216;item1&#8242;].&#8221;&#8216; where &#8230;&#8221;;<br />
Having said that we should talk about the form and php variable transmission, if the form of a &lt;input name = &#8220;item1&#8243; type = &#8220;text&#8221; id = &#8220;item1&#8243;&gt;<br />
POST to submit the form, then the document can be dealt with the form used $ _ POST [ &#8216;item1&#8242;] are variable values, the same is submitted to GET $ _ GET [ &#8216;item1&#8242;]<br />
Is not very simple » But usually $ exec a problem, because the SQL statement you may be very long, you will be missed. Connectors, or &#8216;to field surrounded character.<br />
We can note mysql_query ($ exec); statement to echo $ exec; replace the output to $ exec to check the accuracy. If you are not able to detect $ exec what is wrong, they can copy this sql statement to phpmyadmin in the implementation to see if it&#8217;s an error message. Still needs attention is that we do not use some sensitive field as a string of names, or is likely to have problems, for instance, what the date. The naming of variables, fields that followed the naming of some of their time is a good, beginners can not ignore its importance.</td>
</tr>
<tr>
<td id="submitcell">
<table>
<tr>
<td id="selectcell">
<select name="langpair"><option value="ar|en">阿拉伯文到英语</option><option value="ko|en">朝鲜语到英语</option><option value="de|fr" class="line-above">德语到法语</option><option value="de|en">德语到英语</option><option value="ru|en" class="line-above">俄语到英语</option><option value="fr|de" class="line-above">法语到德语</option><option value="fr|en">法语到英语</option><option value="nl|en" class="line-above">荷兰语到英语</option><option value="pt|en">葡萄牙语到英语</option><option value="ja|en">日语到英语</option><option value="es|en">西班牙语到英语</option><option value="el|en">希腊语到英语</option><option value="it|en">意大利语到英语</option><option value="en|ar" class="line-above">英语到阿拉伯文</option><option value="en|ko">英语到朝鲜语</option><option value="en|de">英语到德语</option><option value="en|ru">英语到俄语</option><option value="en|fr">英语到法语</option><option value="en|nl">英语到荷兰语</option><option value="en|pt">英语到葡萄牙语</option><option value="en|ja">英语到日语</option><option value="en|es">英语到西班牙语</option><option value="en|el">英语到希腊语</option><option value="en|it">英语到意大利语</option><option value="en|zh-TW">英语到中文(繁体)</option><option value="en|zh-CN">英语到中文(简体)</option><option value="zh|en" selected="selected" class="line-above">中文到英语</option><option value="zh-TW|zh-CN">中文(繁体到简体)</option><option value="zh-CN|zh-TW">中文(简体到繁体)</option></select>
</td>
<td>
<input value="翻译" type="submit" /></td>
</tr>
</table>
</td>
<td>&nbsp;</td>
<td align="right"><span style="visibility: visible" id="zippyspan" onclick="_rolldown()"><img src="http://www.google.com/mb/plus_sm.gif" style="margin-right: 0.33em" /></span></td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.pagecity.org/news/learn-php-and-mysql-programingstep-by-step610pagecityorg_15/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Learn PHP and mysql programing:Step by step(5/10,pagecity.org)</title>
		<link>http://www.pagecity.org/news/learn-php-and-mysql-programingstep-by-step510pagecityorg_14/</link>
		<comments>http://www.pagecity.org/news/learn-php-and-mysql-programingstep-by-step510pagecityorg_14/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 20:47:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.pagecity.org/news/learn-php-and-mysql-programingstep-by-step510pagecityorg_14/</guid>
		<description><![CDATA[Learning Objective: To learn to read data
Look at the two functions:
1, mysql_query
Submit a query string. Grammar: int mysql_query (string query, int [link_identifier]); return value: integer
This function submit query string for MySQL related to the handling or implementation. If not specified link_identifier parameters, the program will automatically find the nearest open ID. When the query is [...]]]></description>
			<content:encoded><![CDATA[<p>Learning Objective: To learn to read data<br />
Look at the two functions:<br />
1, mysql_query<br />
Submit a query string. Grammar: int mysql_query (string query, int [link_identifier]); return value: integer<br />
This function submit query string for MySQL related to the handling or implementation. If not specified link_identifier parameters, the program will automatically find the nearest open ID. When the query is a query string UPDATE, INSERT and DELETE, is likely to return to the true or false; SELECT query string is then returned to the new ID value, when returns false, is not without the return of the successful implementation of value, but for A string of errors.<br />
2, mysql_fetch_object to return to categories of information. Grammar: object mysql_fetch_object (int result, int [result_typ]); return value: Class<br />
This function will be used to query results result in the demolition to the variable category. If the result do not have the information, then returns false values.<br />
Look at a simple example:<br />
&lt; »<br />
$ exec = &#8220;select * from user&#8221;;<br />
$ result = mysql_query ($ exec);<br />
while ($ rs = mysql_fetch_object ($ result))<br />
(<br />
echo &#8220;username:&#8221;. $ rs-&gt; username. &#8220;&lt;br&gt;&#8221;;<br />
)<br />
«&gt;<br />
Of course, the user in the form of a username field, which in similar asp<br />
&lt;%<br />
exec = &#8220;select * from user&#8221;<br />
set rs = server.createobject ( &#8220;adodb.recordset&#8221;)<br />
rs.open exec, conn, 1,1<br />
do while not rs.eof<br />
response.write &#8220;username:&#8221; &amp; rs ( &#8220;username &#8220;)&amp;&#8221;&lt; br&gt;&#8221;<br />
rs.movenext<br />
loop<br />
%&gt;<br />
Of course, have to connect to database, and we typically require_once ( &#8216;conn.php&#8217;); conn.php and said there is a link on the database code.<br />
Two small orders can read data completed the work of the next time that the data added to delete amended.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pagecity.org/news/learn-php-and-mysql-programingstep-by-step510pagecityorg_14/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Learn PHP and mysql programing:Step by step(4/10,pagecity.org)</title>
		<link>http://www.pagecity.org/news/steps-to-steps-to-learn-php-and-mysql-programing410_13/</link>
		<comments>http://www.pagecity.org/news/steps-to-steps-to-learn-php-and-mysql-programing410_13/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 20:34:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.pagecity.org/news/steps-to-steps-to-learn-php-and-mysql-programing410_13/</guid>
		<description><![CDATA[Learning Objective: Institute of connecting to the database
It is a PHP library, rich PHP function to some parts of quite simple. We down a proposal of the PHP function manual, used to the total.
I am here to say to connect MYSQL database.
1, mysql_connect
Open MySQL server connection.
Grammar: int mysql_connect (string [hostname] [: port], string [username], string [...]]]></description>
			<content:encoded><![CDATA[<p>Learning Objective: Institute of connecting to the database<br />
It is a PHP library, rich PHP function to some parts of quite simple. We down a proposal of the PHP function manual, used to the total.<br />
I am here to say to connect MYSQL database.<br />
1, mysql_connect<br />
Open MySQL server connection.<br />
Grammar: int mysql_connect (string [hostname] [: port], string [username], string [password]); return value: integer<br />
This function with the establishment of the MySQL server connectivity. All of these parameters can be omitted. When using this function does not add any parameters, the parameters of the hostname default is localhost, the default username parameters for PHP implementation of the itinerary owner, parameters for password empty string (that is not password). The parameters hostname behind the colon and can increase the port, representatives of which use the port and MySQL connection. Of course, in using the database, as soon as possible the use of mysql_close () will connect switched off to save resources.<br />
2, mysql_select_db<br />
Select a database.<br />
Grammar: int mysql_select_db (string database_name, int [link_identifier]); return value: integer<br />
The function of choice in the MySQL database server for the following information for operations (query) treatment. Successful return true, then failed to return false.<br />
The simplest example is:<br />
$ conn = mysql_connect ( &#8220;127.0.0.1&#8243;, &#8220;&#8221;, &#8220;&#8221;);<br />
mysql_select_db ( &#8220;shop&#8221;);<br />
Link-MY SQL databases, open SHOP database. In practical application should be strengthened at a wrong judgement.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pagecity.org/news/steps-to-steps-to-learn-php-and-mysql-programing410_13/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Learn PHP and mysql programing:Step by step(3/10,pagecity.org)</title>
		<link>http://www.pagecity.org/news/steps-to-steps-to-learn-php-and-mysql-programing310_12/</link>
		<comments>http://www.pagecity.org/news/steps-to-steps-to-learn-php-and-mysql-programing310_12/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 20:34:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.pagecity.org/news/steps-to-steps-to-learn-php-and-mysql-programing310_12/</guid>
		<description><![CDATA[Objective: Construction Institute database
In ASP, if it is ACCESS database you can open the MDB ACCESS to edit the document, if you can open SQL SERVER Enterprise Manager to edit SQL SERVER database, but in PHP, MY SQL command line editing may be beginners Am very troublesome, it does not matter, you download the installation [...]]]></description>
			<content:encoded><![CDATA[<p>Objective: Construction Institute database<br />
In ASP, if it is ACCESS database you can open the MDB ACCESS to edit the document, if you can open SQL SERVER Enterprise Manager to edit SQL SERVER database, but in PHP, MY SQL command line editing may be beginners Am very troublesome, it does not matter, you download the installation of a PHPMYADMIN, after the establishment of Kaota can edit the database.<br />
Below talk about its use.<br />
Entered the phpmyadmin, we first need to create a database,<br />
Language (*) here for the Simplified Chinese, then the left to create a new database here fill in name of the database, to create a click.<br />
The drop-down menu on the left and then select the database that has been created. In the following<br />
In the database shop in the creation of a new table:<br />
Name:<br />
Field:<br />
Fill in the form name and generally do you think the field (or more are not does not matter, the future may add or default), according to the Executive.<br />
Then you can start the establishment of the table.<br />
The first column is the name field; second column select field type:<br />
We used the following:<br />
1) VARCHAR, type text<br />
2) INT, type Integer<br />
3) FLOAT, floating-point type<br />
4) DATE, the date of<br />
5) We may ask, automatically add the ID where » INT as long as the choice of this type, in the back of the additional choice auto_increment it.<br />
After the establishment of a table, you can see the establishment of the left in the table, after the click, you can:<br />
1) the right of the structure: Show modified form of<br />
2) Click the right here: the data in Table View<br />
3) the right of the SQL: running SQL statement<br />
4) the right of the insert: Insert his record<br />
5) the right of the Empty: delete all records in the table<br />
6) the right to delete: Delete table<br />
There is also a very important feature is the import and export, when we do a good job in the local procedures and databases, required on the server has a local mirror, if the ACCESS ASP is a simple, direct upload files that MDB May, if it is SQL SERVER can also connect remote server import. MY SQL then you can export all of the SQL statement to the remote server PHPMYADMIN, create a database and then click SQL, Niantie you just copy all of this level can be generated SQL statement.<br />
Here today and tomorrow to say that the database operation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pagecity.org/news/steps-to-steps-to-learn-php-and-mysql-programing310_12/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Learn PHP and mysql programing:Step by step(2/10)</title>
		<link>http://www.pagecity.org/news/steps-to-steps-to-learn-php-and-mysql-programing210_11/</link>
		<comments>http://www.pagecity.org/news/steps-to-steps-to-learn-php-and-mysql-programing210_11/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 20:33:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.pagecity.org/news/steps-to-steps-to-learn-php-and-mysql-programing210_11/</guid>
		<description><![CDATA[Learning Objective: To control the flow control php
1, if .. else cycle of three structures
The first one is only used if conditions, as a simple judgement. Cheng explained, &#8220;if something happened, how to deal with.&#8221; Syntax is as follows:
if (expr) (statement)
The expr for judging the conditions, are often used as symbols judgement logic operation conditions. [...]]]></description>
			<content:encoded><![CDATA[<p>Learning Objective: To control the flow control php<br />
1, if .. else cycle of three structures<br />
The first one is only used if conditions, as a simple judgement. Cheng explained, &#8220;if something happened, how to deal with.&#8221; Syntax is as follows:<br />
if (expr) (statement)<br />
The expr for judging the conditions, are often used as symbols judgement logic operation conditions. The statement was in line with the conditions operative procedures, and his party only if the process can be omitted braces ().<br />
Example: in this case omitted the brackets.<br />
&lt;? php<br />
if ($ state == 1) echo &#8220;. He&#8221;;<br />
«&gt;<br />
Here special attention is to determine whether the same is not == =, ASP programmers may often commit this error, = is the assignment.<br />
Example: in this case the operative part of a three lines, can not be omitted from the brackets.<br />
&lt;? php<br />
if ($ state == 1) (<br />
echo &#8220;. He;<br />
echo &#8220;&lt;br&gt;&#8221;;<br />
)<br />
«&gt;<br />
In addition to the first two is if, coupled with the conditions else, could be interpreted as &#8220;if something happened, how to deal with, or how to solve.&#8221; Syntax is as follows<br />
if (expr) (statement1) else (statement2) Example: the above example to edit into a more complete treatment. Only one else because of his implementation of the directive and therefore do not have to add braces.<br />
&lt;? php<br />
if ($ state == 1) (<br />
echo &#8220;. He&#8221;;<br />
echo &#8220;&lt;br&gt;&#8221;;<br />
)<br />
else (<br />
echo &#8220;Oh&#8221;;<br />
echo &#8220;&lt;br&gt;&#8221;;<br />
)<br />
«&gt;<br />
The third is the recurrent cycle of if .. else, usually used in a variety of decision-making judgement. It will a few if .. else used the merger application processing.<br />
Direct look at the following example<br />
&lt;? php<br />
if ($ a&gt; $ b) (<br />
echo &#8220;a major than b&#8221;;<br />
) Elseif ($ a == $ b) (<br />
echo &#8220;a mean b&#8221;;<br />
) Else (<br />
echo &#8220;a smaller than b&#8221;;<br />
)<br />
«&gt;<br />
On the second floor of the cases only if .. else cycle, a and b used to compare the two variables. Actual use of this recurrent cycle if .. else, please be used with care, because too many of the cycle tends to design the logic of the problem, or less playing a big brackets, the procedure will appear baffling problem.<br />
2, for the simple cycle only one, has not changed, its syntax is as follows<br />
for (expr1; expr2; expr3) (statement)<br />
Expr1 one of the conditions for the initial value. expr2 to judge the conditions are usually used logical symbols (logical operators) when the judgement of the conditions. expr3 to implement the statement after the implementation of the part used to change the conditions for the next cycle of judgement, such as plus-one .. and so on. The statement was in line with the conditions operative procedures, and his party only if the process can be omitted braces ().<br />
The following example is written in the cycle for example.<br />
&lt;? php<br />
for ($ i = 1; $ i &lt;= 10; $ i + +) (<br />
echo &#8220;This is the first&#8221;. $ i. &#8220;cycles &lt;br&gt;&#8221;;<br />
)<br />
«&gt;<br />
3, switch cycle, usually dealing with complex conditions judgement, each of the conditions, the instructions are part of case. In practice, if the use of many similar if instructions, it can be integrated into a switch cycle.<br />
Syntax is as follows<br />
switch (expr) (case expr1: statement1; break; case expr2: statement2; break; default: statementN; break;)<br />
The expr conditions, usually variable name. And the case after the exprN, usually expressed variable value. After the colon is in conformity with the conditions to the implementation part. Attention should break Tiaoli cycle.<br />
&lt;? php<br />
switch (date ( &#8220;D&#8221;)) (<br />
case &#8220;Mon&#8221;:<br />
echo &#8220;today Monday&#8221;;<br />
break;<br />
case &#8220;Tue&#8221;:<br />
echo &#8220;Today, Tuesday&#8221;;<br />
break;<br />
case &#8220;Wed&#8221;:<br />
echo &#8220;today Wednesday&#8221;;<br />
break;<br />
case &#8220;Thu&#8221;:<br />
echo &#8220;this Thursday&#8221;;<br />
break;<br />
case &#8220;Fri&#8221;:<br />
echo &#8220;this Friday&#8221;;<br />
break;<br />
default:<br />
echo &#8220;leave today&#8221;;<br />
break;<br />
)<br />
«&gt;<br />
It should be noted that the break; other omitted, default, the omission can be.<br />
Obviously, if the above example with very cycle of trouble. Of course, in the design, to the greatest probability of the conditions in front, at least the conditions on the final face, can increase the efficiency of the implementation process. On the cases because of the probability of the same day, so do not have to pay attention to the order.<br />
Here today, tomorrow that the use of the database.</p>
<p>by pagecity.org : http://www.pagecity.org</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pagecity.org/news/steps-to-steps-to-learn-php-and-mysql-programing210_11/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Learn PHP and mysql programing:Step by step(1/10)</title>
		<link>http://www.pagecity.org/news/steps-to-steps-to-learn-php-and-mysql-programing110_10/</link>
		<comments>http://www.pagecity.org/news/steps-to-steps-to-learn-php-and-mysql-programing110_10/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 20:31:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.pagecity.org/news/steps-to-steps-to-learn-php-and-mysql-programing110_10/</guid>
		<description><![CDATA[Below a brief introduction to PHP syntax.
1, embedded:
ASP similar to the &#60;%, PHP can be &#60;? Php or &#60; », the end symbol is«&#62;, of course, you can also specify their own.
2, cited documents:
The paper quoted two ways: require and include.
require the use of methods such as require ( &#8220;MyRequireFile.php&#8221;);. This function is usually placed [...]]]></description>
			<content:encoded><![CDATA[<p>Below a brief introduction to PHP syntax.<br />
1, embedded:<br />
ASP similar to the &lt;%, PHP can be &lt;? Php or &lt; », the end symbol is«&gt;, of course, you can also specify their own.<br />
2, cited documents:<br />
The paper quoted two ways: require and include.<br />
require the use of methods such as require ( &#8220;MyRequireFile.php&#8221;);. This function is usually placed on top of the PHP process, PHP in the implementation of procedures before the first reading would require the introduction of the specified documents, PHP so that it becomes a part of the page program. Commonly used functions, this method will also be introducing its pages.<br />
include the use of methods such as the include ( &#8220;MyIncludeFile.php&#8221;);. This function is generally on the handling of process control in part. PHP procedures include page read in the paper when it will come read it. In this way, can the process of implementation of the process simplified.<br />
3, notes:<br />
&lt;? php<br />
echo &#8220;This is the first example. \ n&#8221;; / / This example is the C + + syntax of the Notes<br />
/ * This example of a multi-line<br />
Notes way * /<br />
echo &#8220;This is the second example. \ n&#8221;;<br />
echo &#8220;This is the third example. \ n&#8221;; # in this case the use of UNIX Shell Grammar Notes<br />
«&gt;<br />
4, variable type:<br />
$ mystring = &#8220;I am a string&#8221;;<br />
$ NewLine = &#8220;for the line \ n&#8221;;<br />
$ int1 = 38;<br />
$ float1 = 1.732;<br />
$ float2 = 1.4E +2;<br />
$ MyArray1 = array ( &#8220;son&#8221; and &#8220;ugly&#8221; and &#8220;yin&#8221; and &#8220;d&#8221;);<br />
This leads to two questions, first of all PHP variables to $ beginning, the second sentence to PHP; at the end, may ASP programmers will not adapting. The two procedures are mostly left out of the wrong.<br />
5, computing symbols:<br />
Math:<br />
Symbolic significance<br />
+ Addition operator<br />
&#8211; Subtraction operation<br />
* Multiplication<br />
/ Division operation<br />
% From the balance<br />
+ + Cumulative<br />
&#8211; Decreasing</p>
<p>String operation:<br />
There is only one operator symbols, English is the full stop. It will link up the string, a merger of the new string. Similar to the ASP &amp;<br />
&lt; »<br />
$ a = &#8220;PHP 4&#8243;;<br />
$ b = &#8220;powerful&#8221;;<br />
echo $ a. $ b;<br />
«&gt;<br />
Here also raises two questions, first of all exports in the PHP language is the echo, the second in similar ASP &lt;% = variable%&gt;, PHP can also be &lt; »= variable»&gt;.<br />
Logical:<br />
Symbolic significance<br />
&lt;&lt;<br />
&gt;&gt;<br />
&lt;= Less than or equal to<br />
&gt; = Greater than or equal to<br />
== Equivalent<br />
! Not mean =<br />
&amp; &amp; And (And)<br />
and and (And)<br />
| | Or (Or)<br />
or or (Or)<br />
xor vary or (Xor)<br />
! Not (Not)<br />
Here today, tomorrow, said the process control.</p>
<p>by pagecity.org : http://www.pagecity.org</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pagecity.org/news/steps-to-steps-to-learn-php-and-mysql-programing110_10/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
