<?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>Nisi's work blog &#187; mysql</title>
	<atom:link href="http://wiki.nisi.ro/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://wiki.nisi.ro</link>
	<description>Nisi's work blog - programing tips</description>
	<lastBuildDate>Mon, 21 Nov 2011 08:43:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>How to replace substring in MySQL table field</title>
		<link>http://wiki.nisi.ro/2011/03/how-to-replace-substring-in-mysql-table-field/</link>
		<comments>http://wiki.nisi.ro/2011/03/how-to-replace-substring-in-mysql-table-field/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 12:30:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[instr]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[where]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=368</guid>
		<description><![CDATA[This replace will search in every row of the table where condition from WHERE is true and replace function will replace all instances in a string. ex. if you have text &#8220;hello world&#8221; and you want to replace the &#8220;o&#8221; letter with &#8220;*&#8221; this will will transform the text in &#8220;hell* w*rld&#8221; UPDATE `mytable` SET [...]]]></description>
			<content:encoded><![CDATA[<p>This replace will search in every row of the table where condition from WHERE is true and replace function will replace all instances in a string.</p>
<p>ex. if you have text &#8220;hello world&#8221; and you want to replace the &#8220;o&#8221; letter with &#8220;*&#8221; this will will transform the text in &#8220;hell* w*rld&#8221;</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">UPDATE</span> `mytable`</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">SET</span> my_content = <span class="kw1">REPLACE</span><span class="br0">&#40;</span>content, <span class="st0">&#8216;substr_string_to_replace&#8217;</span>,<span class="st0">&#8216;the_new_string&#8217;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">WHERE</span> <span class="kw1">INSTR</span><span class="br0">&#40;</span>content, <span class="st0">&#8216;substr_string_to_replace&#8217;</span><span class="br0">&#41;</span> &gt; <span class="nu0">0</span>;</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2011/03/how-to-replace-substring-in-mysql-table-field/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL: Select &#8220;last month&#8221; records</title>
		<link>http://wiki.nisi.ro/2011/02/mysql-select-last-month-records/</link>
		<comments>http://wiki.nisi.ro/2011/02/mysql-select-last-month-records/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 12:27:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[last month]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[records]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=363</guid>
		<description><![CDATA[In order to select last month records you have to get first dai of the last month and the last day of the first month. Remember that current month could be January and the last month will in another year. Finding first day of the last month: DATE_FORMAT&#40;CURRENT_DATE &#8211; INTERVAL 1 MONTH, &#34;%Y-%m-01&#34;&#41; Finding the [...]]]></description>
			<content:encoded><![CDATA[<p>In order to select last month records you have to get first dai of the last month and the last day of the first month.</p>
<p>Remember that current month could be January and the last month will in another year.</p>
<p>Finding first day of the last month:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">DATE_FORMAT</span><span class="br0">&#40;</span><span class="kw1">CURRENT_DATE</span> &#8211; <span class="kw1">INTERVAL</span> <span class="nu0">1</span> <span class="kw4">MONTH</span>, <span class="st0">&quot;%Y-%m-01&quot;</span><span class="br0">&#41;</span></div>
</li>
</ol>
</div>
<p>Finding the last thay of the last month:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">LAST_DAY</span><span class="br0">&#40;</span><span class="kw1">CURRENT_DATE</span> &#8211; <span class="kw1">INTERVAL</span> <span class="nu0">1</span> <span class="kw4">MONTH</span><span class="br0">&#41;</span></div>
</li>
</ol>
</div>
<p>And the final Query is:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">SELECT</span> *</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">FROM</span> `my_table`</div>
</li>
<li class="li1">
<div class="de1">`<span class="kw2">DATE</span>` <span class="kw5">BETWEEN</span> <span class="kw1">DATE_FORMAT</span><span class="br0">&#40;</span><span class="kw1">CURRENT_DATE</span> &#8211; <span class="kw1">INTERVAL</span> <span class="nu0">1</span> <span class="kw4">MONTH</span>, <span class="st0">&quot;%Y-%m-01&quot;</span><span class="br0">&#41;</span> <span class="kw5">AND</span> <span class="kw1">LAST_DAY</span><span class="br0">&#40;</span><span class="kw1">CURRENT_DATE</span> &#8211; <span class="kw1">INTERVAL</span> <span class="nu0">1</span> <span class="kw4">MONTH</span><span class="br0">&#41;</span></div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2011/02/mysql-select-last-month-records/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL: select &#8220;this month&#8221; records</title>
		<link>http://wiki.nisi.ro/2011/02/mysql-select-this-month-records/</link>
		<comments>http://wiki.nisi.ro/2011/02/mysql-select-this-month-records/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 12:20:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[select this month]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=361</guid>
		<description><![CDATA[Where &#8220;date&#8221; column is a Date type in &#8220;my_table&#8221; SELECT * FROM `my_table` WHERE YEAR&#40;`DATE`&#41; = YEAR&#40;CURDATE&#40;&#41;&#41; AND MONTH&#40;`DATE`&#41; = MONTH&#40;CURDATE&#40;&#41;&#41;]]></description>
			<content:encoded><![CDATA[<p>Where &#8220;date&#8221; column is a Date type in &#8220;my_table&#8221;</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">SELECT</span> * </div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">FROM</span> `my_table`</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">WHERE</span> <span class="kw2">YEAR</span><span class="br0">&#40;</span>`<span class="kw2">DATE</span>`<span class="br0">&#41;</span> = <span class="kw2">YEAR</span><span class="br0">&#40;</span><span class="kw1">CURDATE</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="kw5">AND</span> <span class="kw4">MONTH</span><span class="br0">&#40;</span>`<span class="kw2">DATE</span>`<span class="br0">&#41;</span> = <span class="kw4">MONTH</span><span class="br0">&#40;</span><span class="kw1">CURDATE</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span></div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2011/02/mysql-select-this-month-records/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL: Select last 7 days records</title>
		<link>http://wiki.nisi.ro/2011/02/mysql-select-last-7-days-records/</link>
		<comments>http://wiki.nisi.ro/2011/02/mysql-select-last-7-days-records/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 12:14:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[last 7 days]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[select]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=357</guid>
		<description><![CDATA[For this example I use this table model: ID Name Date 1 Jon Dow 2011-01-10 2 Jane Dow 2011-01-10 … … … SELECT * FROM `my_table` WHERE `DATE` BETWEEN DATE_ADD&#40;CURDATE&#40;&#41;, INTERVAL -5 DAY&#41; AND CURDATE&#40;&#41;]]></description>
			<content:encoded><![CDATA[<p>For this example I use this table model:</p>
<table border="1" style="margin-bottom: 20px;">
<tbody>
<tr>
<td>ID</td>
<td>Name</td>
<td>Date</td>
</tr>
<tr>
<td>1</td>
<td>Jon Dow</td>
<td>2011-01-10</td>
</tr>
<tr>
<td>2</td>
<td>Jane Dow</td>
<td>2011-01-10</td>
</tr>
<tr>
<td>…</td>
<td>…</td>
<td>…</td>
</tr>
</tbody>
</table>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">SELECT</span> *</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">FROM</span> `my_table`</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">WHERE</span> `<span class="kw2">DATE</span>` <span class="kw5">BETWEEN</span> <span class="kw1">DATE_ADD</span><span class="br0">&#40;</span><span class="kw1">CURDATE</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="kw1">INTERVAL</span> <span class="nu0">-5</span> <span class="kw1">DAY</span><span class="br0">&#41;</span> <span class="kw5">AND</span> <span class="kw1">CURDATE</span><span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2011/02/mysql-select-last-7-days-records/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL: Select today, yesterday or day before yesterday records</title>
		<link>http://wiki.nisi.ro/2011/01/mysql-select-today-yesterday-or-day-before-yesterday-records/</link>
		<comments>http://wiki.nisi.ro/2011/01/mysql-select-today-yesterday-or-day-before-yesterday-records/#comments</comments>
		<pubDate>Mon, 10 Jan 2011 09:29:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[yesterday records select]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=351</guid>
		<description><![CDATA[Usualy when you work with records where a date or timestamp field is present you need to select records from: today records yesterday records day before yesterday records Lets say you have a table (my_table) like this: ID Name Date 1 Jon Dow 2011-01-10 2 Jane Dow 2011-01-10 &#8230; &#8230; &#8230; where `Date` is date [...]]]></description>
			<content:encoded><![CDATA[<p>Usualy when you work with records where a date or timestamp field is present you need to select records from:</p>
<ul>
<li>today records</li>
<li>yesterday records</li>
<li>day before yesterday records</li>
</ul>
<p>Lets say you have a table (my_table) like this:</p>
<table border="1">
<tbody>
<tr>
<td>ID</td>
<td>Name</td>
<td>Date</td>
</tr>
<tr>
<td>1</td>
<td>Jon Dow</td>
<td>2011-01-10</td>
</tr>
<tr>
<td>2</td>
<td>Jane Dow</td>
<td>2011-01-10</td>
</tr>
<tr>
<td>&#8230;</td>
<td>&#8230;</td>
<td>&#8230;</td>
</tr>
</tbody>
</table>
<p>where `Date` is date type field</p>
<p><strong>Today records:</strong></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">SELECT</span> *</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">FROM</span> `my_table`</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">WHERE</span> `<span class="kw2">DATE</span>` = <span class="kw1">CURDATE</span><span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
</ol>
</div>
<p><strong>Yesterday records:</strong></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">SELECT</span> *</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">FROM</span> `my_table`</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">WHERE</span> `<span class="kw2">DATE</span>` &gt; <span class="kw1">DATE_ADD</span><span class="br0">&#40;</span><span class="kw1">CURDATE</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="kw1">INTERVAL</span> <span class="nu0">-2</span> <span class="kw1">DAY</span><span class="br0">&#41;</span> <span class="kw5">AND</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `<span class="kw2">DATE</span>` &lt; <span class="kw1">CURDATE</span><span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
</ol>
</div>
<p><strong>Day before yesterday records:</strong></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">SELECT</span> *</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">FROM</span> `my_table`</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">WHERE</span> `<span class="kw2">DATE</span>` &gt; <span class="kw1">DATE_ADD</span><span class="br0">&#40;</span><span class="kw1">CURDATE</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="kw1">INTERVAL</span> <span class="nu0">-3</span> <span class="kw1">DAY</span><span class="br0">&#41;</span> <span class="kw5">AND</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `<span class="kw2">DATE</span>` &lt; <span class="kw1">DATE_ADD</span><span class="br0">&#40;</span><span class="kw1">CURDATE</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="kw1">INTERVAL</span> <span class="nu0">-2</span> <span class="kw1">DAY</span><span class="br0">&#41;</span></div>
</li>
</ol>
</div>
<p>If your `Date` field is a timestamp or datetime then replace `Date` with date(`Date`)</p>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2011/01/mysql-select-today-yesterday-or-day-before-yesterday-records/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Neural Networks in PHP</title>
		<link>http://wiki.nisi.ro/2010/03/neural-networks-in-php/</link>
		<comments>http://wiki.nisi.ro/2010/03/neural-networks-in-php/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 10:43:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[adaptive learning]]></category>
		<category><![CDATA[mesh]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[neural]]></category>
		<category><![CDATA[neural network]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web api]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=202</guid>
		<description><![CDATA[Browsing phpclasses.org I had found a very interesting article Neural Networks in PHP . For anyone who dont know yet &#8220;Neural networks allow emulating the behavior of a human brain in software applications.&#8221; In this article you can read how to implement Neural Mesh to develop Neural Network applications in PHP. (Neural Networks in PHP) [...]]]></description>
			<content:encoded><![CDATA[<p>Browsing phpclasses.org I had found a very interesting article <strong><a href="http://www.phpclasses.org/blog/post/119-Neural-Networks-in-PHP.html" target="_blank">Neural Networks in PHP</a> .</strong> For anyone who dont know yet <em>&#8220;Neural networks allow emulating the behavior of a human brain in software applications.&#8221;</em></p>
<p>In this article you can read how to implement Neural Mesh to develop Neural Network applications in PHP. (<strong><a href="http://www.phpclasses.org/blog/post/119-Neural-Networks-in-PHP.html" target="_blank">Neural Networks in PHP</a></strong><em>)</em></p>
<p><strong>Neural Mesh</strong><em> </em>is an open source, pure PHP code based Neural Network manager and framework that makes it easier to work with Neural Networks.</p>
<p>Neural Mesh home page: <a href="http://neuralmesh.com/" target="_blank">http://neuralmesh.com/</a></p>
<ul>
<li>Pure PHP &amp; MySQl</li>
<li>Adaptive Learning</li>
<li>Implement in any enviroment</li>
<li>Web Api</li>
<li>Fast</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2010/03/neural-networks-in-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Restore MySql database using command line</title>
		<link>http://wiki.nisi.ro/2009/12/restore-mysql-database-using-command-line/</link>
		<comments>http://wiki.nisi.ro/2009/12/restore-mysql-database-using-command-line/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 11:55:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[dbname]]></category>
		<category><![CDATA[dump.sql]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[restore]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[user]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=169</guid>
		<description><![CDATA[mysql -u USER -p DBNAME &#60; dump.sql Where: USER is your username DBNAME is Databas witch will be restored dump.sql (any .sql file can be used) is your database dump]]></description>
			<content:encoded><![CDATA[<p>mysql -u USER -p DBNAME &lt; dump.sql</p>
<p>Where:</p>
<ul>
<li><strong>USER</strong> is your username</li>
<li><strong>DBNAME</strong> is Databas witch will be restored</li>
<li><strong>dump.sql</strong> (any .sql file can be used) is your database dump</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2009/12/restore-mysql-database-using-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Format PHP Date to MySQL Format</title>
		<link>http://wiki.nisi.ro/2008/05/format-php-date-to-mysql-format/</link>
		<comments>http://wiki.nisi.ro/2008/05/format-php-date-to-mysql-format/#comments</comments>
		<pubDate>Sat, 17 May 2008 00:07:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[Website's]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[timestamp]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=19</guid>
		<description><![CDATA[When you insert or update a date in a mysql Table you have to remember that Mysql have 3 types of date DATETIME         ( default format 0000-00-00 00:00:00 ) DATE                ( default format 0000-00-00 ) TIMESTAMP      ( default format 0000-00-00 00:00:00 ) PHP code:       DATE -&#62;  $mysqldate = date( &#8216;Y-m-d&#8217; );       DATETIME, TSTAMP [...]]]></description>
			<content:encoded><![CDATA[<p><br />
When you insert or update a date in a mysql Table you have to remember that Mysql have 3 types of date</p>
<ul>
<li>DATETIME         ( default format 0000-00-00 00:00:00 )</li>
<li>DATE                ( default format 0000-00-00 )</li>
<li>TIMESTAMP      ( default format 0000-00-00 00:00:00 )</li>
</ul>
<p>PHP code:</p>
<ol>
<li>      DATE -&gt;  $mysqldate = date( &#8216;Y-m-d&#8217; );</li>
<li>      DATETIME, TSTAMP  -&gt; $mysqldate = date( &#8216;Y-m-d H:i:s&#8217;);</li>
</ol>
<p>Now maybe you have have read some date field from MySql table and want to convert it to PHP date</p>
<ul>
<li>$phpdate = strtotime( $mysqldate );</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2008/05/format-php-date-to-mysql-format/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL variables range</title>
		<link>http://wiki.nisi.ro/2008/04/mysql-variables-range/</link>
		<comments>http://wiki.nisi.ro/2008/04/mysql-variables-range/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 17:08:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[PHP & MySQL]]></category>
		<category><![CDATA[Website's]]></category>
		<category><![CDATA[blob]]></category>
		<category><![CDATA[flot]]></category>
		<category><![CDATA[int]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[range]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[varchar]]></category>
		<category><![CDATA[variables]]></category>

		<guid isPermaLink="false">http://wiki.nisi.ro/?p=18</guid>
		<description><![CDATA[TINYINT A very small integer The signed range is –128 to 127. The unsigned range is 0 to 255. SMALLINT A small integer The signed range is –32768 to 32767. The unsigned range is 0 to 65535 MEDIUMINT A medium-size integer The signed range is –8388608 to 8388607. The unsigned range is 0 to 16777215 [...]]]></description>
			<content:encoded><![CDATA[<p><br />
<strong>TINYINT</strong><br />
A very small integer<br />
The signed <span class="hilite3">range</span> is –128 to 127. The unsigned <span class="hilite3">range</span> is 0 to 255.</p>
<p><strong>SMALLINT</strong><br />
A small integer<br />
The signed <span class="hilite3">range</span> is –32768 to 32767. The unsigned <span class="hilite3">range</span> is 0 to 65535</p>
<p><strong>MEDIUMINT</strong><br />
A medium-size integer<br />
The signed <span class="hilite3">range</span> is –8388608 to 8388607. The unsigned <span class="hilite3">range</span> is 0 to 16777215</p>
<p><strong>INT</strong> or <strong>INTEGER</strong><br />
A normal-size integer<br />
The signed <span class="hilite3">range</span> is –2147483648 to 2147483647. The unsigned <span class="hilite3">range</span> is 0 to 4294967295</p>
<p><strong>BIGINT</strong><br />
A large integer<br />
The signed <span class="hilite3">range</span> is –9223372036854775808 to 9223372036854775807. The unsigned <span class="hilite3">range</span> is 0 to 18446744073709551615</p>
<p><strong>FLOAT</strong><br />
A small (single-precision) floating-point number. Cannot be unsigned<br />
Ranges are –3.402823466E+38 to –1.175494351E-38, 0 and 1.175494351E-38 to 3.402823466E+38. If the number of Decimals is not set or &lt;= 24 it is a single-precision floating point number</p>
<p><strong>DOUBLE</strong>,<br />
<strong>DOUBLE PRECISION</strong>,<br />
<strong>REAL</strong><br />
A normal-size (double-precision) floating-point number. Cannot be unsigned<br />
Ranges are -1.7976931348623157E+308 to -2.2250738585072014E-308, 0 and 2.2250738585072014E-308 to 1.7976931348623157E+308. If the number of Decimals is not set or 25 &lt;= Decimals &lt;= 53 stands for a double-precision floating point number</p>
<p><strong>DECIMAL</strong>,<br />
<strong>NUMERIC</strong><br />
An unpacked floating-point number. Cannot be unsigned<br />
Behaves like a CHAR column: “unpacked” means the number is stored as a string, using one character for each digit of the value. The decimal point, and, for negative numbers, the ‘-‘ sign is not counted in Length. If Decimals is 0, values will have no decimal point or fractional part. The maximum <span class="hilite3">range</span> of DECIMAL values is the same as for DOUBLE, but the actual <span class="hilite3">range</span> for a given DECIMAL column may be constrained by the choice of Length and Decimals. If Decimals is left out it’s set to 0. If Length is left out it’s set to 10. Note that in <span class="hilite1">MySQL</span> 3.22 the Length includes the sign and the decimal point</p>
<p><strong>DATE</strong><br />
A date<br />
The supported <span class="hilite3">range</span> is ‘1000-01-01’ to ‘9999-12-31’. <span class="hilite1">MySQL</span> displays DATE values in ‘YYYY-MM-DD’ format</p>
<p><strong>DATETIME</strong><br />
A date and time combination<br />
The supported <span class="hilite3">range</span> is ‘1000-01-01 00:00:00’ to ‘9999-12-31 23:59:59’. <span class="hilite1">MySQL</span> displays DATETIME values in ‘YYYY-MM-DD HH:MM:SS’ format</p>
<p><strong>TIMESTAMP</strong><br />
A timestamp<br />
The <span class="hilite3">range</span> is ‘1970-01-01 00:00:00’ to sometime in the year 2037. <span class="hilite1">MySQL</span> displays TIMESTAMP values in YYYYMMDDHHMMSS, YYMMDDHHMMSS, YYYYMMDD or YYMMDD format, depending on whether M is 14 (or missing), 12, 8 or 6, but allows you to assign values to TIMESTAMP columns using either strings or numbers. A TIMESTAMP column is useful for recording the date and time of an INSERT or UPDATE operation because it is automatically set to the date and time of the most recent operation if you don’t give it a value yourself</p>
<p><strong>TIME</strong><br />
A time<br />
The <span class="hilite3">range</span> is ‘-838:59:59’ to ‘838:59:59’. <span class="hilite1">MySQL</span> displays TIME values in ‘HH:MM:SS’ format, but allows you to assign values to TIME columns using either strings or numbers</p>
<p><strong>YEAR</strong><br />
A year in 2- or 4- digit formats (default is 4-digit)<br />
The allowable values are 1901 to 2155, and 0000 in the 4 year format and 1970-2069 if you use the 2 digit format (70-69). <span class="hilite1">MySQL</span> displays YEAR values in YYYY format, but allows you to assign values to YEAR columns using either strings or numbers. (The YEAR type is new in <span class="hilite1">MySQL</span> 3.22.)</p>
<p><strong>CHAR</strong><br />
A fixed-length string that is always right-padded with spaces to the specified length when stored<br />
The <span class="hilite3">range</span> of Length is 1 to 255 characters. Trailing spaces are removed when the value is retrieved. CHAR values are sorted and compared in case-insensitive fashion according to the default character set unless the BINARY keyword is given</p>
<p><span class="hilite2"><strong>VARCHAR</strong></span><br />
A variable-length string. Note: Trailing spaces are removed when the value is stored (this differs from the ANSI SQL specification)<br />
The <span class="hilite3">range</span> of Length is 1 to 255 characters. <span class="hilite2">VARCHAR</span> values are sorted and compared in case-insensitive fashion unless the BINARY keyword is given</p>
<p><strong>TINYBLOB</strong>,<br />
<strong>TINYTEXT</strong></p>
<p>A <strong>BLOB</strong> or <strong>TEXT</strong> column with a maximum length of 255 (2^8 &#8211; 1) characters</p>
<p><strong>BLOB</strong>,<br />
<strong>TEXT </strong></p>
<p>A BLOB or TEXT column with a maximum length of 65535 (2^16 &#8211; 1) characters</p>
<p><strong>MEDIUMBLOB</strong>,<br />
<strong>MEDIUMTEXT</strong></p>
<p>A BLOB or TEXT column with a maximum length of 16777215 (2^24 &#8211; 1) characters</p>
<p><strong>LONGBLOB</strong>,<br />
<strong>LONGTEXT</strong></p>
<p>A <strong>BLOB</strong> or <strong>TEXT</strong> column with a maximum length of 4294967295 (2^32 &#8211; 1) characters</p>
<p><strong>ENUM</strong><br />
An enumeration<br />
A string object that can have only one value, chosen from the list of values ‘value1’, ‘value2’, &#8230;, or NULL. An ENUM can have a maximum of 65535 distinct values.</p>
<p><strong>SET</strong><br />
A set<br />
A string object that can have zero or more values, each of which must be chosen from the list of values ‘value1’, ‘value2’, &#8230; A SET can have a maximum of 64 members </p>
]]></content:encoded>
			<wfw:commentRss>http://wiki.nisi.ro/2008/04/mysql-variables-range/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

