<?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>Evolution Systems &#187; MySQL</title>
	<atom:link href="http://evolution-systems.co.uk/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://evolution-systems.co.uk</link>
	<description>Web Development, Software Development and Linux Consultancy services</description>
	<lastBuildDate>Fri, 08 Aug 2025 09:18:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.42</generator>
	<item>
		<title>Get Next Auto Increment Value</title>
		<link>http://evolution-systems.co.uk/2008/09/24/get-next-auto-increment-value-2/</link>
		<comments>http://evolution-systems.co.uk/2008/09/24/get-next-auto-increment-value-2/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 22:46:11 +0000</pubDate>
		<dc:creator><![CDATA[Matthew Jakeman]]></dc:creator>
				<category><![CDATA[Matts Blog]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://evolution-systems.co.uk/wordpress/?p=502</guid>
		<description><![CDATA[Earlier today I had the need to try and discover the next auto increment value in a MySQL table. I haven&#8217;t needed to do this before so I headed over to google to have a look for how to accomplish it. A lot of information I found said to use a &#8216;SELECT MAX&#8230;&#8217;. This would [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Earlier today I had the need to try and discover the next auto increment value in a MySQL table. I haven&#8217;t needed to do this before so I headed over to google to have a look for how to accomplish it.</p>
<p>A lot of information I found said to use a &#8216;SELECT MAX&#8230;&#8217;. This would work fine as long as nothing gets deleted from the end of the database. I ended up finding a nice blog entry <a href="http://blog.jamiedoris.com/geek/560/">here</a> that explains exactly how to do it. The following code snippet taken from the site above shows how to get the next value.</p>
<p><code><?php<br />$tablename 		= "tablename";<br />$next_increment 	= 0;<br />$qShowStatus 		= "SHOW TABLE STATUS LIKE '$tablename'";<br />$qShowStatusResult 	= mysql_query($qShowStatus);</p>
<p>$row = mysql_fetch_assoc($qShowStatusResult);<br />$next_increment = $row['Auto_increment'];</p>
<p>echo "next increment number: [$next_increment]";<br />
?></code></p>
<p>Quite a useful piece of info&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://evolution-systems.co.uk/2008/09/24/get-next-auto-increment-value-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert MySql timestamp field to Unix Time Stamp</title>
		<link>http://evolution-systems.co.uk/2008/03/20/convert-mysql-timestamp-field-to-unix-time-stamp-2/</link>
		<comments>http://evolution-systems.co.uk/2008/03/20/convert-mysql-timestamp-field-to-unix-time-stamp-2/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 16:48:23 +0000</pubDate>
		<dc:creator><![CDATA[Matthew Jakeman]]></dc:creator>
				<category><![CDATA[Matts Blog]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP Functions]]></category>
		<category><![CDATA[Time]]></category>

		<guid isPermaLink="false">http://evolution-systems.co.uk/wordpress/?p=511</guid>
		<description><![CDATA[As anyone who has used MySql and PHP in the past to deal with time and date will probably know MySql timestamp fields are not compatible in anyway with PHP&#8217;s date() function. Because of this you need to do conversions in order to use the information from the MySql database. The following function will convert [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>As anyone who has used MySql and PHP in the past to deal with time and date will probably know MySql timestamp fields are not compatible in anyway with PHP&#8217;s date() function. Because of this you need to do conversions in order to use the information from the MySql database. The following function will convert a value from a database into a unix timestamp format for easier manipulation within your PHP code. I have found it quite useful to have around so am putting it up here for others to take advantage of.</p>
<p><code>/*<br />  * Convert MySql timestamp to unix timestamp<br />  */<br />function ts2unix($ts)<br />{<br />  $year    = substr($ts,0,4);<br />  $month   = substr($ts,4,2);<br />  $day     = substr($ts,6,2);<br />  $hour    = substr($ts,8,2);<br />  $minute  = substr($ts,10,2);<br />  $second  = substr($ts,12,2);<br />  $uts = mktime($hour,$minute,$second,$month,$day,$year);<br />  return ($uts);<br />}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://evolution-systems.co.uk/2008/03/20/convert-mysql-timestamp-field-to-unix-time-stamp-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
