<?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>Prodromus &#187; Uncategorized</title>
	<atom:link href="http://www.prodromus.com/category/uncategorized/feed" rel="self" type="application/rss+xml" />
	<link>http://www.prodromus.com</link>
	<description>A forerunner to the future...</description>
	<lastBuildDate>Mon, 14 Jun 2010 20:06:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MySQL &#8211; DateTime vs. TimeStamp &#8211; When to use?</title>
		<link>http://www.prodromus.com/2010/06/12/mysql-datetime-vs-timestamp-when-to-use</link>
		<comments>http://www.prodromus.com/2010/06/12/mysql-datetime-vs-timestamp-when-to-use#comments</comments>
		<pubDate>Sat, 12 Jun 2010 14:00:09 +0000</pubDate>
		<dc:creator>Prodromus</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[current date]]></category>
		<category><![CDATA[current time zone]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[date time]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[datetime field]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[syncronize]]></category>
		<category><![CDATA[syntax]]></category>
		<category><![CDATA[timestamp]]></category>
		<category><![CDATA[TimeZone]]></category>
		<category><![CDATA[type]]></category>

		<guid isPermaLink="false">http://www.prodromus.com/?p=291</guid>
		<description><![CDATA[This question often comes up, and while there is often a heated debate, these are my thoughts on the subject.
I typically use a timestamp when I need to record a fixed point in time. For example when a record was inserted into the database or when some useraction took place that resulted in a row [...]]]></description>
			<content:encoded><![CDATA[<p>This question often comes up, and while there is often a heated debate, these are my thoughts on the subject.</p>
<p>I typically use a timestamp when I need to record a fixed point in time. For example when a record was inserted into the database or when some useraction took place that resulted in a row being updated.   The Timestamp data type has various features that allow it to automatically perform this function.   The default value for the Timestamp data type results in it being set to the current_date when a new row is added.  If you as the On Update syntax, this value will also be updated whenever the row is updated.</p>
<p><span style="font-size: 13.3333px;">I use a datetime field when the date/time can be set and changed arbitrarily. For example when the field can be updated based on specific events or actions, besides a simple row Update.  In addition, a TimeStamp field can only store dates since 1970, so if you need to store dates in the past, such as a birthday, you must use DateTime.</span></p>
<p>A couple other things to keep in mind, TimeStamp fields support the TimeZone setting on your server.  For example, i<span style="font-size: 13.3333px;">f I have a database in Europe, and take a dump of that database to syncronize/populate a database in America, then the timestamp would update to reflect the real time of the event in the new time zone, while datetime would still reflect the time of the event in the European timezone.  By default, the current time zone for each connection is the server&#8217;s time, however the time zone can be set on a per-connection basis.</span></p>
<p>Lastly, TIMESTAMP stores its value in 4 bytes, while DATETIME uses 8 bytes.  This is the main reason why TimeStamp has a lower limit of 1970.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.prodromus.com%2F2010%2F06%2F12%2Fmysql-datetime-vs-timestamp-when-to-use&amp;title=MySQL%20-%20DateTime%20vs.%20TimeStamp%20-%20When%20to%20use%3F&amp;bodytext=This%20question%20often%20comes%20up%2C%20and%20while%20there%20is%20often%20a%20heated%20debate%2C%20these%20are%20my%20thoughts%20on%20the%20subject.%0D%0A%0D%0AI%20typically%20use%20a%20timestamp%20when%20I%20need%20to%20record%20a%20fixed%20point%20in%20time.%20For%20example%20when%20a%20record%20was%20inserted%20into%20the%20database%20or%20when" title="Digg"><img src="http://www.prodromus.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.prodromus.com%2F2010%2F06%2F12%2Fmysql-datetime-vs-timestamp-when-to-use&amp;submitHeadline=MySQL%20-%20DateTime%20vs.%20TimeStamp%20-%20When%20to%20use%3F&amp;submitSummary=This%20question%20often%20comes%20up%2C%20and%20while%20there%20is%20often%20a%20heated%20debate%2C%20these%20are%20my%20thoughts%20on%20the%20subject.%0D%0A%0D%0AI%20typically%20use%20a%20timestamp%20when%20I%20need%20to%20record%20a%20fixed%20point%20in%20time.%20For%20example%20when%20a%20record%20was%20inserted%20into%20the%20database%20or%20when&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.prodromus.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.prodromus.com%2F2010%2F06%2F12%2Fmysql-datetime-vs-timestamp-when-to-use&amp;title=MySQL%20-%20DateTime%20vs.%20TimeStamp%20-%20When%20to%20use%3F" title="StumbleUpon"><img src="http://www.prodromus.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.prodromus.com%2F2010%2F06%2F12%2Fmysql-datetime-vs-timestamp-when-to-use&amp;title=MySQL%20-%20DateTime%20vs.%20TimeStamp%20-%20When%20to%20use%3F&amp;notes=This%20question%20often%20comes%20up%2C%20and%20while%20there%20is%20often%20a%20heated%20debate%2C%20these%20are%20my%20thoughts%20on%20the%20subject.%0D%0A%0D%0AI%20typically%20use%20a%20timestamp%20when%20I%20need%20to%20record%20a%20fixed%20point%20in%20time.%20For%20example%20when%20a%20record%20was%20inserted%20into%20the%20database%20or%20when" title="del.icio.us"><img src="http://www.prodromus.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.prodromus.com%2F2010%2F06%2F12%2Fmysql-datetime-vs-timestamp-when-to-use&amp;t=MySQL%20-%20DateTime%20vs.%20TimeStamp%20-%20When%20to%20use%3F" title="Facebook"><img src="http://www.prodromus.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=MySQL%20-%20DateTime%20vs.%20TimeStamp%20-%20When%20to%20use%3F&amp;body=http%3A%2F%2Fwww.prodromus.com%2F2010%2F06%2F12%2Fmysql-datetime-vs-timestamp-when-to-use" title="email"><img src="http://www.prodromus.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.prodromus.com%2F2010%2F06%2F12%2Fmysql-datetime-vs-timestamp-when-to-use&amp;partner=sociable" title="Print"><img src="http://www.prodromus.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.prodromus.com%2F2010%2F06%2F12%2Fmysql-datetime-vs-timestamp-when-to-use&amp;title=MySQL%20-%20DateTime%20vs.%20TimeStamp%20-%20When%20to%20use%3F" title="Mixx"><img src="http://www.prodromus.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.prodromus.com%2F2010%2F06%2F12%2Fmysql-datetime-vs-timestamp-when-to-use&amp;title=MySQL%20-%20DateTime%20vs.%20TimeStamp%20-%20When%20to%20use%3F&amp;annotation=This%20question%20often%20comes%20up%2C%20and%20while%20there%20is%20often%20a%20heated%20debate%2C%20these%20are%20my%20thoughts%20on%20the%20subject.%0D%0A%0D%0AI%20typically%20use%20a%20timestamp%20when%20I%20need%20to%20record%20a%20fixed%20point%20in%20time.%20For%20example%20when%20a%20record%20was%20inserted%20into%20the%20database%20or%20when" title="Google Bookmarks"><img src="http://www.prodromus.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.prodromus.com/2010/06/12/mysql-datetime-vs-timestamp-when-to-use/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL &#8211; SQL Injection, and how to Prevent it</title>
		<link>http://www.prodromus.com/2010/06/11/mysql-sql-injection-and-how-to-prevent-it</link>
		<comments>http://www.prodromus.com/2010/06/11/mysql-sql-injection-and-how-to-prevent-it#comments</comments>
		<pubDate>Fri, 11 Jun 2010 20:04:29 +0000</pubDate>
		<dc:creator>Prodromus</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.prodromus.com/?p=296</guid>
		<description><![CDATA[SQL injection vulnerabilities are often been described as the most serious threat for Web applications, regardless of what language they are written in . Web applications that are vulnerable to SQL injection may allow an attacker to gain complete access to their underlying databases, regardless of if they are using MySQL Server, SQL Server, or [...]]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_295" class="wp-caption alignnone" style="width: 510px"><a href="http://www.prodromus.com/wp-content/uploads/2010/06/xkcd1.png"><img class="size-full wp-image-295" title="xkcd[1]" src="http://www.prodromus.com/wp-content/uploads/2010/06/xkcd1.png" alt="Stop SQL Injection" width="500"  /></a><p class="wp-caption-text">Bobby Tables and the lesson he teaches</p></div>SQL injection vulnerabilities are often been described as the most serious threat for Web applications, regardless of what language they are written in . Web applications that are vulnerable to SQL injection may allow an attacker to gain complete access to their underlying databases, regardless of if they are using MySQL Server, SQL Server, or Oracle.</p>
<p><span style="font-size: 13.3333px;">SQL-injection attacks are those in which data provided by the user is included in an SQL query in such a way that part of the user&#8217;s input is treated as SQL code that is executed on the server.   By using this technique, an attacker can submit SQL commands directly to the database.   These attacks are a serious threat to any Web application that receives input from users and passes it into SQL queries to an underlying database server.  If  user input is not santised properly, web applications may result in SQL Injection attacks that allow hackers to view information from the database and/or even wipe it out.</span></p>
<p>To defend against SQL Injection attacks, user input must not directly be embedded into SQL statements that are executed on the server.  Instead, you must use parameterized statements, and Escaping functions to check user input.</p>
<p>Various resource for addressing SQL Injection are as follows:</p>
<p>Bobby Tables provides real-world practical code for addressing SQL Injection - <a href="http://bobby-tables.com/">http://bobby-tables.com/<br />
</a>Michal Daw&#8217;s Blog Page outlines various SQL Injection vectors - <a href="http://michaeldaw.org/sql-injection-cheat-sheet">http://michaeldaw.org/sql-injection-cheat-sheet</a></p>
<p><span style="font-size: 13.3333px;"><br />
</span></p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.prodromus.com%2F2010%2F06%2F11%2Fmysql-sql-injection-and-how-to-prevent-it&amp;title=MySQL%20-%20SQL%20Injection%2C%20and%20how%20to%20Prevent%20it&amp;bodytext=SQL%20injection%20vulnerabilities%20are%20often%20been%20described%20as%20the%20most%20serious%20threat%20for%20Web%20applications%2C%20regardless%20of%20what%20language%20they%20are%20written%20in%20.%20Web%20applications%20that%20are%20vulnerable%20to%20SQL%20injection%20may%20allow%20an%20attacker%20to%20gain%20complete%20acc" title="Digg"><img src="http://www.prodromus.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.prodromus.com%2F2010%2F06%2F11%2Fmysql-sql-injection-and-how-to-prevent-it&amp;submitHeadline=MySQL%20-%20SQL%20Injection%2C%20and%20how%20to%20Prevent%20it&amp;submitSummary=SQL%20injection%20vulnerabilities%20are%20often%20been%20described%20as%20the%20most%20serious%20threat%20for%20Web%20applications%2C%20regardless%20of%20what%20language%20they%20are%20written%20in%20.%20Web%20applications%20that%20are%20vulnerable%20to%20SQL%20injection%20may%20allow%20an%20attacker%20to%20gain%20complete%20acc&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.prodromus.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.prodromus.com%2F2010%2F06%2F11%2Fmysql-sql-injection-and-how-to-prevent-it&amp;title=MySQL%20-%20SQL%20Injection%2C%20and%20how%20to%20Prevent%20it" title="StumbleUpon"><img src="http://www.prodromus.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.prodromus.com%2F2010%2F06%2F11%2Fmysql-sql-injection-and-how-to-prevent-it&amp;title=MySQL%20-%20SQL%20Injection%2C%20and%20how%20to%20Prevent%20it&amp;notes=SQL%20injection%20vulnerabilities%20are%20often%20been%20described%20as%20the%20most%20serious%20threat%20for%20Web%20applications%2C%20regardless%20of%20what%20language%20they%20are%20written%20in%20.%20Web%20applications%20that%20are%20vulnerable%20to%20SQL%20injection%20may%20allow%20an%20attacker%20to%20gain%20complete%20acc" title="del.icio.us"><img src="http://www.prodromus.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.prodromus.com%2F2010%2F06%2F11%2Fmysql-sql-injection-and-how-to-prevent-it&amp;t=MySQL%20-%20SQL%20Injection%2C%20and%20how%20to%20Prevent%20it" title="Facebook"><img src="http://www.prodromus.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=MySQL%20-%20SQL%20Injection%2C%20and%20how%20to%20Prevent%20it&amp;body=http%3A%2F%2Fwww.prodromus.com%2F2010%2F06%2F11%2Fmysql-sql-injection-and-how-to-prevent-it" title="email"><img src="http://www.prodromus.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.prodromus.com%2F2010%2F06%2F11%2Fmysql-sql-injection-and-how-to-prevent-it&amp;partner=sociable" title="Print"><img src="http://www.prodromus.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.prodromus.com%2F2010%2F06%2F11%2Fmysql-sql-injection-and-how-to-prevent-it&amp;title=MySQL%20-%20SQL%20Injection%2C%20and%20how%20to%20Prevent%20it" title="Mixx"><img src="http://www.prodromus.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.prodromus.com%2F2010%2F06%2F11%2Fmysql-sql-injection-and-how-to-prevent-it&amp;title=MySQL%20-%20SQL%20Injection%2C%20and%20how%20to%20Prevent%20it&amp;annotation=SQL%20injection%20vulnerabilities%20are%20often%20been%20described%20as%20the%20most%20serious%20threat%20for%20Web%20applications%2C%20regardless%20of%20what%20language%20they%20are%20written%20in%20.%20Web%20applications%20that%20are%20vulnerable%20to%20SQL%20injection%20may%20allow%20an%20attacker%20to%20gain%20complete%20acc" title="Google Bookmarks"><img src="http://www.prodromus.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.prodromus.com/2010/06/11/mysql-sql-injection-and-how-to-prevent-it/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
