<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Xyiry PHP Blog &#124; Where Open Source Lives &#187; MySQL</title>
	<atom:link href="http://php.xyiry.com/category/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://php.xyiry.com</link>
	<description>My open source playground</description>
	<lastBuildDate>Wed, 18 Nov 2009 12:06:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to Start / Stop Mysql Service in Linux</title>
		<link>http://php.xyiry.com/how-to-start-stop-mysql-service-in-linux/</link>
		<comments>http://php.xyiry.com/how-to-start-stop-mysql-service-in-linux/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 23:08:38 +0000</pubDate>
		<dc:creator>Xyiry</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://php.xyiry.com/how-to-start-stop-mysql-service-in-linux/</guid>
		<description><![CDATA[This is how you can start or stop your MySQL service in linux environment.
1)  /etc/init.d/mysql start    &#8212;-To start MySQL service
/etc/init.d/mysql stop     &#8212;-To stop MySQL service
2)  service mysqld start
service mysqld stop
service mysqld restart
]]></description>
			<content:encoded><![CDATA[<p>This is how you can start or stop your MySQL service in linux environment.</p>
<p>1)  /etc/init.d/mysql start    &#8212;-To start MySQL service</p>
<p>/etc/init.d/mysql stop     &#8212;-To stop MySQL service</p>
<p>2)  service mysqld start<br />
service mysqld stop<br />
service mysqld restart</p>
]]></content:encoded>
			<wfw:commentRss>http://php.xyiry.com/how-to-start-stop-mysql-service-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL General Statements</title>
		<link>http://php.xyiry.com/mysql-general-statements/</link>
		<comments>http://php.xyiry.com/mysql-general-statements/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 07:44:42 +0000</pubDate>
		<dc:creator>Xyiry</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://php.xyiry.com/mysql-general-statements/</guid>
		<description><![CDATA[Dump and Restore MySQL DB
mysqldump -u username -p username dbname&#62; filename.sql
mysql -u root -p dbname&#60; filename.sql
Table of Contents
* mysql_affected_rows — Get number of affected rows in previous MySQL operation
* mysql_change_user — Change logged in user of the active connection
* mysql_client_encoding — Returns the name of the character set
* mysql_close — Close MySQL connection
* mysql_connect — [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Dump and Restore MySQL DB</strong></p>
<p>mysqldump -u username -p username dbname&gt; filename.sql</p>
<p>mysql -u root -p dbname&lt; filename.sql</p>
<p>Table of Contents</p>
<p>* mysql_affected_rows — Get number of affected rows in previous MySQL operation<br />
* mysql_change_user — Change logged in user of the active connection<br />
* mysql_client_encoding — Returns the name of the character set<br />
* mysql_close — Close MySQL connection<br />
* mysql_connect — Open a connection to a MySQL Server<br />
* mysql_create_db — Create a MySQL database<br />
* mysql_data_seek — Move internal result pointer<br />
* mysql_db_name — Get result data<br />
* mysql_db_query — Send a MySQL query<br />
* mysql_drop_db — Drop (delete) a MySQL database<br />
* mysql_errno — Returns the numerical value of the error message from previous MySQL operation<br />
* mysql_error — Returns the text of the error message from previous MySQL operation<br />
* mysql_escape_string — Escapes a string for use in a mysql_query<br />
* mysql_fetch_array — Fetch a result row as an associative array, a numeric array, or both<br />
* mysql_fetch_assoc — Fetch a result row as an associative array<br />
* mysql_fetch_field — Get column information from a result and return as an object<br />
* mysql_fetch_lengths — Get the length of each output in a result<br />
* mysql_fetch_object — Fetch a result row as an object<br />
* mysql_fetch_row — Get a result row as an enumerated array<br />
* mysql_field_flags — Get the flags associated with the specified field in a result<br />
* mysql_field_len — Returns the length of the specified field<br />
* mysql_field_name — Get the name of the specified field in a result<br />
* mysql_field_seek — Set result pointer to a specified field offset<br />
* mysql_field_table — Get name of the table the specified field is in<br />
* mysql_field_type — Get the type of the specified field in a result<br />
* mysql_free_result — Free result memory<br />
* mysql_get_client_info — Get MySQL client info<br />
* mysql_get_host_info — Get MySQL host info<br />
* mysql_get_proto_info — Get MySQL protocol info<br />
* mysql_get_server_info — Get MySQL server info<br />
* mysql_info — Get information about the most recent query<br />
* mysql_insert_id — Get the ID generated from the previous INSERT operation<br />
* mysql_list_dbs — List databases available on a MySQL server<br />
* mysql_list_fields — List MySQL table fields<br />
* mysql_list_processes — List MySQL processes<br />
* mysql_list_tables — List tables in a MySQL database<br />
* mysql_num_fields — Get number of fields in result<br />
* mysql_num_rows — Get number of rows in result<br />
* mysql_pconnect — Open a persistent connection to a MySQL server<br />
* mysql_ping — Ping a server connection or reconnect if there is no connection<br />
* mysql_query — Send a MySQL query<br />
* mysql_real_escape_string — Escapes special characters in a string for use in a SQL statement<br />
* mysql_result — Get result data<br />
* mysql_select_db — Select a MySQL database<br />
* mysql_set_charset — Sets the client character set<br />
* mysql_stat — Get current system status<br />
* mysql_tablename — Get table name of field<br />
* mysql_thread_id — Return the current thread ID<br />
* mysql_unbuffered_query — Send an SQL query to MySQL, without fetching and buffering the result rows</p>
]]></content:encoded>
			<wfw:commentRss>http://php.xyiry.com/mysql-general-statements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL &amp; PHP- Paging statement</title>
		<link>http://php.xyiry.com/hello-world/</link>
		<comments>http://php.xyiry.com/hello-world/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 07:30:00 +0000</pubDate>
		<dc:creator>Xyiry</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[//VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
// MySQL &#38; PHP- Paging statement
//VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
Here we go -&#62;
&#60;?
$MONTH=$_REQUEST['MONTH'];
$pos = $_REQUEST['no']; // Number input by user
$display = &#8220;10&#8243;;
$gettot = mysql_query(&#8221;SELECT * FROM user_services where BALANCE !=&#8221; and MONTH=&#8217;$MONTH&#8217;&#8221;);
$totnum = @mysql_num_rows($gettot);
$result = mysql_query(&#8221;SELECT * FROM user_services where NRIC != &#8221; and BALANCE !=&#8221; and MONTH=&#8217;$MONTH&#8217; order by DATE LIMIT $pos, $display&#8221;);
?&#62;
&#60;?
//You can put this code at [...]]]></description>
			<content:encoded><![CDATA[<p>//VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV<br />
// MySQL &amp; PHP- Paging statement<br />
//VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV</p>
<p>Here we go -&gt;</p>
<p>&lt;?<br />
$MONTH=$_REQUEST['MONTH'];</p>
<p>$pos = $_REQUEST['no']; // Number input by user<br />
$display = &#8220;10&#8243;;</p>
<p>$gettot = mysql_query(&#8221;SELECT * FROM user_services where BALANCE !=&#8221; and MONTH=&#8217;$MONTH&#8217;&#8221;);<br />
$totnum = @mysql_num_rows($gettot);<br />
$result = mysql_query(&#8221;SELECT * FROM user_services where NRIC != &#8221; and BALANCE !=&#8221; and MONTH=&#8217;$MONTH&#8217; order by DATE LIMIT $pos, $display&#8221;);<br />
?&gt;</p>
<p>&lt;?</p>
<p>//You can put this code at the bottom of your PHP script, because this is to display the next, previous and page number links</p>
<p>$num_pages = ceil($totnum / $display);</p>
<p>if($totnum &gt; $display) {</p>
<p>// this is previous links<br />
if($pos &gt; 0){<br />
echo &#8220;&lt;A href=\&#8221;result_view_NRIC .php?no=&#8221;.($pos &#8211; $display) .&#8221;&amp;NRIC =$NRIC \&#8221;&gt;&lt;prev&lt;/A&gt; | &#8220;;<br />
} else {<br />
echo &#8220;&lt;prev | &#8220;;<br />
}</p>
<p><span id="more-1"></span><br />
// this is no page links<br />
$i = 0;<br />
while($i &lt; $num_pages){<br />
$page = $i * $display;<br />
$i++;<br />
if($page != $pos){<br />
echo &#8220;&lt;A href=\&#8221;result_view_NRIC .php?no=$page&amp;NRIC =$NRIC \&#8221;&gt;$i&lt;/A&gt; | &#8220;;<br />
} else {<br />
echo &#8220;$i | &#8220;;<br />
}<br />
}</p>
<p>// this is next links<br />
if($pos &lt; (($num_pages &#8211; 1) * $display)){<br />
echo &#8220;&lt;A href=\&#8221;result_view_NRIC .php?no=&#8221; . ($pos + $display) . &#8220;&amp;NRIC =$NRIC \&#8221;&gt;next&gt;&lt;/A&gt;&#8221;;<br />
} else {<br />
echo &#8220;next&gt;&#8221;;<br />
}</p>
<p>}</p>
<p>?&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://php.xyiry.com/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Help &#8211; Find difference between two dates</title>
		<link>http://php.xyiry.com/mysql-help-find-difference-between-two-dates/</link>
		<comments>http://php.xyiry.com/mysql-help-find-difference-between-two-dates/#comments</comments>
		<pubDate>Fri, 10 Aug 2007 16:30:09 +0000</pubDate>
		<dc:creator>Xyiry</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://php.xyiry.com/?p=9</guid>
		<description><![CDATA[//VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
// MySQL Help &#8211; Find difference between two dates
//VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
&#60;?
//programmer : Xyiry
// Oracle find different in days
$date1 = &#8220;07-OCT-06&#8243;;
$date2 = &#8220;26-sep-06&#8243;;
echo &#8220;Difference between $date1 and $date2 = &#8220;.diff_days($date1,$date2);
function diff_days($start_date, $end_date)
{
if ($start_date==&#8221;") return 0;
return floor((strtotime($start_date) &#8211; strtotime($end_date))/86400);
}
?&#62;
]]></description>
			<content:encoded><![CDATA[<p>//VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV<br />
// MySQL Help &#8211; Find difference between two dates<br />
//VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV<br />
&lt;?<br />
//programmer : Xyiry<br />
// Oracle find different in days</p>
<p>$date1 = &#8220;07-OCT-06&#8243;;<br />
$date2 = &#8220;26-sep-06&#8243;;</p>
<p>echo &#8220;Difference between $date1 and $date2 = &#8220;.diff_days($date1,$date2);</p>
<p>function diff_days($start_date, $end_date)<br />
{<br />
if ($start_date==&#8221;") return 0;<br />
return floor((strtotime($start_date) &#8211; strtotime($end_date))/86400);<br />
}<br />
?&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://php.xyiry.com/mysql-help-find-difference-between-two-dates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
