<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Prodromus</title>
	
	<link>http://www.prodromus.com</link>
	<description>A forerunner to the future...</description>
	<lastBuildDate>Thu, 19 Jan 2012 22:32:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Prodromus" /><feedburner:info uri="prodromus" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Should I hire a SEO consultant? – Search Engine Marketing in Maryland, DC, and Virginia</title>
		<link>http://feedproxy.google.com/~r/Prodromus/~3/EPD5h_Q5uNc/should-i-hire-a-seo-consultant-search-engine-marketing-in-maryland-dc-and-virginia</link>
		<comments>http://www.prodromus.com/2012/01/19/should-i-hire-a-seo-consultant-search-engine-marketing-in-maryland-dc-and-virginia#comments</comments>
		<pubDate>Thu, 19 Jan 2012 22:32:37 +0000</pubDate>
		<dc:creator>Prodromus</dc:creator>
				<category><![CDATA[Pro Bono]]></category>
		<category><![CDATA[SEO - Search Engine Optimization]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[Engine]]></category>
		<category><![CDATA[Frederick]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Internet Reputation]]></category>
		<category><![CDATA[J. C. Penney]]></category>
		<category><![CDATA[Marketing]]></category>
		<category><![CDATA[Maryland]]></category>
		<category><![CDATA[maryland search]]></category>
		<category><![CDATA[Maryland Search Engine Marketing]]></category>
		<category><![CDATA[mobile search]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[Search engine marketing]]></category>
		<category><![CDATA[search engine optimisation]]></category>
		<category><![CDATA[Search engine optimization]]></category>
		<category><![CDATA[search queries]]></category>
		<category><![CDATA[SEO consultant]]></category>
		<category><![CDATA[Thomas JEFFERSON]]></category>
		<category><![CDATA[Thomas Johnson]]></category>
		<category><![CDATA[Thomas Johnson Drive]]></category>
		<category><![CDATA[virginia region]]></category>
		<category><![CDATA[Web search engine]]></category>
		<category><![CDATA[White Hat SEO]]></category>

		<guid isPermaLink="false">http://www.prodromus.com/?p=471</guid>
		<description><![CDATA[A common question that I get from many clients is should they invest in a SEO consultant?  In most cases, I encourage folks to save their money and focus on the standard SEO best practices.  But, if a client does not have the time, or a staff, then by all means hire someone to help [...]]]></description>
			<content:encoded><![CDATA[<p>A common question that I get from many clients is should they invest in a <a class="zem_slink" title="related articles" href="http://www.zemanta.com/related-blog-posts/" rel="zemantacom" target="_blank">SEO</a> consultant?  In most cases, I encourage folks to save their money and focus on the standard SEO best practices.  But, if a client does not have the time, or a staff, then by all means hire someone to help out.  However, do NOT believe the hype.  There are very few magic bullets or tricks that will get you a legitimate high ranking that will not eventually get crushed by <a class="zem_slink" title="Google" href="http://google.com" rel="homepage" target="_blank">Google</a> if the find you &#8220;cheating&#8221;.  Focus on White Hat SEO, focus on content, focus on your customers, and if you follow those rules, you will typically be rewarded by the search gods.</p>
<p>Don&#8217;t fall for paid link programs, make sure you understand what your SEO firm is doing, and check up on them.  Many practices that SEO firms will advocate will eventually cause problems due to Google eventually catching your cheating.  If you are a SEO SPAMer, it is no big deal, just change your domain, and start again.  However, if you are a reputable company, you are putting your Internet Reputation on the line.  If the SEO pitch is too good to be true, don&#8217;t believe it.  If you want to see how even big companies can get crushed, <a title="JC Penny hurts their SEO Rank" href="http://searchenginewatch.com/article/2066346/Big-Brands-and-Bad-Linking-How-to-Avoid-Google-Penalties">read about how JC Penny</a> seriously harmed their Internet Reputation by not closely watching what their SEO consultant was doing.</p>
<p>Did you know that over 20% of all search queries are now being generated by mobile devices?  And, in many of these cases, the search results are heavily influenced by the customer&#8217;s location.  No matter what business you are in, it is even more important that your business is visible, and preferably at the top.  And in areas like the Maryland, DC, Virginia region, optimizing your site to reflect where customers could be searching from is important.   You can&#8217;t just provide your business address and hope customers can guess what areas you may service.  Make it clear where your service areas are.</p>
<p>And, while talking about your address, a couple of tips are in order.  First, make your address and phone number easy to read, and to copy and paste.  Do not embed your address in a graphic.  Yes, I have seen this, and if I had known the designer that did it I would have fired them.   Interestingly, the address for this company was Thomas Johnson Drive in <a class="zem_slink" title="Frederick, Maryland" href="http://maps.google.com/maps?ll=39.4263888889,-77.4202777778&amp;spn=0.1,0.1&amp;q=39.4263888889,-77.4202777778%20%28Frederick%2C%20Maryland%29&amp;t=h" rel="geolocation" target="_blank">Frederick, Maryland</a>.  I tried to copy and paste, but no luck.  Guess how I typed it into Google?  That is right, Thomas JEFFERSON!  Mobile search fail&#8230;</p>
<p>If you are still interested in finding some help with your SEO projects, drop us an email.  We would be happy to help you find the proper resource.</p>
<h6 class="zemanta-related-title">Related articles</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://marketing.yell.com/web-design/what-is-search-engine-optimisation-seo/" target="_blank">What is search engine optimisation (SEO)?</a> (marketing.yell.com)</li>
<li class="zemanta-article-ul-li"><a href="http://marketing.yell.com/web-design/how-to-seo-your-domain-name/" target="_blank">How to SEO your domain name</a> (marketing.yell.com)</li>
<li class="zemanta-article-ul-li"><a href="http://marketing.yell.com/web-design/why-is-google-the-most-important-search-engine-for-businesses-to-rank-in/" target="_blank">Why is Google the most important search engine for businesses to rank in?</a> (marketing.yell.com)</li>
</ul>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=665fe112-1a03-4fb2-9320-04413bc2e213" alt="" /></div>

<p><a href="http://feedads.g.doubleclick.net/~a/vwGqLOfMTjexjvhlvkAlZcdtOLU/0/da"><img src="http://feedads.g.doubleclick.net/~a/vwGqLOfMTjexjvhlvkAlZcdtOLU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/vwGqLOfMTjexjvhlvkAlZcdtOLU/1/da"><img src="http://feedads.g.doubleclick.net/~a/vwGqLOfMTjexjvhlvkAlZcdtOLU/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Prodromus/~4/EPD5h_Q5uNc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.prodromus.com/2012/01/19/should-i-hire-a-seo-consultant-search-engine-marketing-in-maryland-dc-and-virginia/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.prodromus.com/2012/01/19/should-i-hire-a-seo-consultant-search-engine-marketing-in-maryland-dc-and-virginia</feedburner:origLink></item>
		<item>
		<title>Linux Question of the Day – How do I Grep Recursively?</title>
		<link>http://feedproxy.google.com/~r/Prodromus/~3/YP6YvUY8XS4/linux-question-of-the-day-how-do-i-grep-recursively</link>
		<comments>http://www.prodromus.com/2011/12/14/linux-question-of-the-day-how-do-i-grep-recursively#comments</comments>
		<pubDate>Wed, 14 Dec 2011 17:17:02 +0000</pubDate>
		<dc:creator>Prodromus</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[exec grep]]></category>
		<category><![CDATA[Grep]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[question of the day]]></category>
		<category><![CDATA[Recursively]]></category>
		<category><![CDATA[Regular expression]]></category>
		<category><![CDATA[search recursively]]></category>

		<guid isPermaLink="false">http://www.prodromus.com/?p=463</guid>
		<description><![CDATA[Another common question that I hear on a weekly basis. You would think this would be a pretty straightforward answer, and it is. I think the shear number of options available with Grep is what confuses folks.  So, here is the basic way to perform this task. grep -r &#8220;texthere&#8221; . Simple, right?  &#8221;texthere&#8221; is [...]]]></description>
			<content:encoded><![CDATA[<p>Another common question that I hear on a weekly basis. You would think this would be a pretty straightforward answer, and it is. I think the shear number of options available with Grep is what confuses folks.  So, here is the basic way to perform this task.</p>
<p>grep -r &#8220;texthere&#8221; .</p>
<p>Simple, right?  &#8221;texthere&#8221; is the string that you are searching for, and the -r says search recursively starting from the current directory (.).  You can also specify specific filenames or types that you would like to search, such as *.txt, *.php, etc.</p>
<p>On some older <a class="zem_slink" title="Unix" href="http://www.unix.org" rel="homepage" target="_blank">Unix</a> versions, you may find that Grep does not support the -r syntax.  In that case, try the following :</p>
<p>find ./ -type f | xargs grep &#8220;texthere&#8221;</p>
<p>Also som version also will not support searching for *.txt as the filename, in that case, try the following :</p>
<p>find /dir/to/search/ -iname *.txt -exec grep &#8216;texthere&#8217; &#8216;{}&#8217; \;</p>
<p>Little known piece of trivia, <a class="zem_slink" title="Grep" href="http://en.wikipedia.org/wiki/Grep" rel="wikipedia" target="_blank">GREP</a> stands for Get <a class="zem_slink" title="Regular expression" href="http://en.wikipedia.org/wiki/Regular_expression" rel="wikipedia" target="_blank">Regular Expression</a> and Print</p>
<h6 class="zemanta-related-title">Related articles</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://codingexplorer.wordpress.com/2011/10/03/the-grep-command/" target="_blank">The grep Command</a> (codingexplorer.wordpress.com)</li>
<li class="zemanta-article-ul-li"><a href="http://stackoverflow.com/questions/8144754/how-to-use-grep-to-find-data-conveniently-and-quickly" target="_blank">How to use GREP to find data conveniently and quickly</a> (stackoverflow.com)</li>
<li class="zemanta-article-ul-li"><a href="http://noone.org/blog/English/Computer/Shell/grep%2520everything.html" target="_blank">Axel Beckert: grep everything</a> (noone.org)</li>
</ul>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=449ba334-dfb4-4313-80c0-ad87c3baf6cb" alt="" /></div>

<p><a href="http://feedads.g.doubleclick.net/~a/vwIgCe2zRmLH0StwGewOQG69sQk/0/da"><img src="http://feedads.g.doubleclick.net/~a/vwIgCe2zRmLH0StwGewOQG69sQk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/vwIgCe2zRmLH0StwGewOQG69sQk/1/da"><img src="http://feedads.g.doubleclick.net/~a/vwIgCe2zRmLH0StwGewOQG69sQk/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Prodromus/~4/YP6YvUY8XS4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.prodromus.com/2011/12/14/linux-question-of-the-day-how-do-i-grep-recursively/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.prodromus.com/2011/12/14/linux-question-of-the-day-how-do-i-grep-recursively</feedburner:origLink></item>
		<item>
		<title>PHP Code to Open Zip Files and Extract the Contents</title>
		<link>http://feedproxy.google.com/~r/Prodromus/~3/0pLtKWdmdV4/php-code-to-open-zip-files-and-extract-the-contents</link>
		<comments>http://www.prodromus.com/2011/12/08/php-code-to-open-zip-files-and-extract-the-contents#comments</comments>
		<pubDate>Thu, 08 Dec 2011 16:59:38 +0000</pubDate>
		<dc:creator>Prodromus</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zip Files]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PCorner]]></category>
		<category><![CDATA[programmer]]></category>
		<category><![CDATA[zip entry]]></category>
		<category><![CDATA[zip files]]></category>
		<category><![CDATA[zip format]]></category>
		<category><![CDATA[zip functions]]></category>

		<guid isPermaLink="false">http://www.prodromus.com/?p=457</guid>
		<description><![CDATA[I recently was working on a project for a dynamic website that presented a huge collection of files available for download. All of the files (over 25,000) were stored in the ubiquitous ZIP format.  This is great for reducing the amount of disk space required, however it can make it challenging to work with them. [...]]]></description>
			<content:encoded><![CDATA[<p>I recently was working on a project for a dynamic website that presented a huge collection of files available for download. All of the files (over 25,000) were stored in the ubiquitous ZIP format.  This is great for reducing the amount of disk space required, however it can make it challenging to work with them.  What we wanted to do was allow the visitors to the site to be able to review the contents of the file, and view any of the files that are contained within the ZIP file.  <a class="zem_slink" title="PHP" href="http://www.php.net/" rel="homepage" target="_blank">PHP</a> has some handy functions that allow you to manipulate <a class="zem_slink" title="ZIP (file format)" href="http://en.wikipedia.org/wiki/ZIP_%28file_format%29" rel="wikipedia" target="_blank">ZIP files</a>, however they are not well documented.  Although fairly straight-forward, I am including some example code here that will allow you to quickly copy and paste it for your requirements.</p>
<p>The core routines include zip_open() that opens the ZIP file for use.  zip_read then allows you to transverse the ZIP directory to identify the files contained within.   The zip_entry routines provide additional details about the file enclosed, and zip_entry_open() provides the door that allows you to open a specific file and then zip_entry_read allows you to extract the contained file.   On our site, the contained files were mostly text files that could be easily displayed.  Simply iterate through the file collecting the contents into a temporary variable.  If displaying on a webpage, use the handy nl2lbr() function to convert line feeds into HTML line breaks.</p>
<p>All in all, PHP&#8217;s built-in ZIP functions are a handy tool, a few simple lines of code will allow you to easily manipulate ZIP files and allow individual files to be viewed.  Leave a comment if you have any questions or suggestions.  You can see the final site at <a title="The Programmer's Corner" href="http://www.pcorner.com">The Programmer&#8217;s Corner</a>.</p>
<p>Code that will allow you to open a ZIP file, iterate through the directory, and retrieve the files contained within.</p>
<pre>   $zip = zip_open('PCorner/' . $_GET['category'] . '/' . $_GET['file']);
    while ($zip_entry = zip_read($zip)) {
        $output.= '&lt;tr class="' . $class . '"&gt;';
        $output.= '&lt;td&gt;';
        $file = strtoupper(basename(zip_entry_name($zip_entry)));
        $size = zip_entry_filesize($zip_entry);
        $csize = zip_entry_compressedsize($zip_entry);
        $type = zip_entry_compressionmethod($zip_entry);
    }</pre>
<p>Code that will allow you to open a ZIP file, find a specific file, and extract it for viewing, or further manipulation.</p>
<pre>   $zip = zip_open('PCorner/' . $_GET['category'] . '/' . $_GET['file']);
        while ($zip_entry = zip_read($zip)) {
            $file = basename(zip_entry_name($zip_entry));
            if (strtoupper($file) == strtoupper($_GET['operation'])) {
                if (!zip_entry_open($zip, $zip_entry)) {
                    die('');
                }
                while ($data = zip_entry_read($zip_entry)) {
                    $output.= nl2br($data);
                }

            }
        }</pre>
<pre>   echo $output;</pre>
<h6 class="zemanta-related-title">Related articles</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://smartwrite.com.au/2010/11/16/how-to-open-and-extract-a-zip-file/" target="_blank">How To Open And Extract A Zip File</a> (smartwrite.com.au)</li>
<li class="zemanta-article-ul-li"><a href="http://www.callingallgeeks.org/36383/how-to-correct-or-recover-corrupt-zip-files/" target="_blank">How to Correct or Recover Corrupt ZIP Files</a> (callingallgeeks.org)</li>
<li class="zemanta-article-ul-li"><a href="http://jszip.stuartk.co.uk/" target="_blank">JSZip &#8211; Create .zip files with Javascript</a> (jszip.stuartk.co.uk)</li>
</ul>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=853bf2fa-000c-4db9-ab83-440cfcaf7c1b" alt="" /></div>

<p><a href="http://feedads.g.doubleclick.net/~a/HaTNWrqdg6vbw3TkdFeumsfvuOQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/HaTNWrqdg6vbw3TkdFeumsfvuOQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/HaTNWrqdg6vbw3TkdFeumsfvuOQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/HaTNWrqdg6vbw3TkdFeumsfvuOQ/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Prodromus/~4/0pLtKWdmdV4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.prodromus.com/2011/12/08/php-code-to-open-zip-files-and-extract-the-contents/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.prodromus.com/2011/12/08/php-code-to-open-zip-files-and-extract-the-contents</feedburner:origLink></item>
		<item>
		<title>EXTJS – JsonWriter not respecting DateFormat used with JsonReader</title>
		<link>http://feedproxy.google.com/~r/Prodromus/~3/ps7-X7lLNMs/extjs-jsonwriter-not-respecting-dateformat-used-with-jsonreader</link>
		<comments>http://www.prodromus.com/2011/04/15/extjs-jsonwriter-not-respecting-dateformat-used-with-jsonreader#comments</comments>
		<pubDate>Fri, 15 Apr 2011 16:29:37 +0000</pubDate>
		<dc:creator>Prodromus</dc:creator>
				<category><![CDATA[Extjs]]></category>
		<category><![CDATA[JsonStore]]></category>
		<category><![CDATA[DataReader]]></category>
		<category><![CDATA[DataWriter]]></category>
		<category><![CDATA[dateformat]]></category>
		<category><![CDATA[EditorGrid]]></category>
		<category><![CDATA[Ext]]></category>
		<category><![CDATA[Ext (JavaScript library)]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Jsonreader]]></category>
		<category><![CDATA[JsonWriter]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.prodromus.com/?p=439</guid>
		<description><![CDATA[Recently while working on a project that used Extjs as the front-end to a MySQL application, we came across an interesting issue with Extjs&#8217;s JsonStore.  The JsonStore automatically creates a Jsonreader that is used to map data coming from the MySQL application to the Extjs front-end.  The JsonReader has an optional dateFormat config property which [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img zemanta-action-dragged" style="margin: 1em; display: block;">
<div class="mceTemp">
<dl class="wp-caption alignright" style="width: 250px;">
<dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/File:ExtJs-Desktop.png"><img title="A screenshot of the Ext 2.0 Web Desktop Sample App" src="http://www.prodromus.com/wp-content/uploads/2011/04/ExtJs-Desktop3.png" alt="A screenshot of the Ext 2.0 Web Desktop Sample App" width="240" height="317" /></a></dt>
</dl>
</div>
</div>
<p>Recently while working on a project that used <a class="zem_slink" title="Ext (JavaScript library)" rel="homepage" href="http://www.sencha.com/products/js/">Extjs</a> as the front-end to a <a class="zem_slink" title="MySQL" rel="homepage" href="http://www.mysql.com">MySQL</a> application, we came across an interesting issue with Extjs&#8217;s <a title="Extjs Documentation for JsonStore" href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.data.JsonStore" target="_blank">JsonStore</a>.  The JsonStore automatically creates a Jsonreader that is used to map data coming from the MySQL application to the Extjs front-end.  The <a title="Extjs Documentation for JsonReader" href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.data.JsonReader" target="_blank">JsonReader </a>has an optional dateFormat config property which allows the format of the incoming data to be read properly using the format delivered from MySQL.  While using the <a title="Extjs Documentation for JsonWriter" href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.data.JsonWriter" target="_blank">JsonWriter </a>to update records from a EditorGrid, we noticed that the format that was sent back from the JsonWriter was using Extjs&#8217;s default dateFormat (03-04-2011T00:00:00).</p>
<p>It was that the JsonWriter was not respecting the dateFormat defined when mapping the data using JsonReader.  There would appear to be multiple hacks that could be used to fix, such as adding a Listener before the update that would modify the datefield, however we came across this little bit of code that works wonders.  This code will over-ride the default DataWriter class to use the dateFormat property defined in the JsonStore Field mappings.</p>
<p><code>//This over-ride fixes JsonWriter not using the JsonReader dateFormat when writing</code></p>
<p><code>Ext.override(Ext.data.DataWriter, { toHash : function(rec) {<br />
var map = rec.fields.map,<br />
data = {},<br />
raw = (this.writeAllFields === false &amp;&amp; rec.phantom === false) ? rec.getChanges() : rec.data,<br />
m;</code></p>
<p><code>Ext.iterate(raw, function(prop, value){<br />
if((m = map[prop])){<br />
var key = m.mapping ? m.mapping : m.name;<br />
if (m.dateFormat &amp;&amp; Ext.isDate(value)) {<br />
data[key] = value.format(m.dateFormat);<br />
} else {<br />
data[key] = value;<br />
}<br />
}<br />
});<br />
// we don't want to write Ext auto-generated id to hash.  Careful not to remove it on Models not having auto-increment pk though.<br />
// We can tell its not auto-increment if the user defined a DataReader field for it *and* that field's value is non-empty.<br />
// we could also do a RegExp here for the Ext.data.Record AUTO_ID prefix.<br />
if (rec.phantom) {<br />
if (rec.fields.containsKey(this.meta.idProperty) &amp;&amp; Ext.isEmpty(rec.data[this.meta.idProperty])) {<br />
delete data[this.meta.idProperty];<br />
}<br />
} else {<br />
data[this.meta.idProperty] = rec.id<br />
}<br />
return data;<br />
}<br />
});</code></p>
<p><code> </code></p>
<p><span style="font-weight: bold;">Related articles</span></p>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://labs.omniti.com/labs/jsend">JSend: a specification for how JSON responses should be formatted</a> (labs.omniti.com)</li>
<li class="zemanta-article-ul-li"><a href="http://blog.apigee.com/apigee_blog/detail/why_you_should_build_your_next_api_using_json/">Why You Should Build Your Next API Using JSON</a> (apigee.com)</li>
<li class="zemanta-article-ul-li"><a href="http://onlinejournalismblog.com/2011/04/14/data-for-journalists-json-for-beginners/">Data for journalists: JSON for beginners</a> (onlinejournalismblog.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/pixy.gif?x-id=a7f7390a-f5ca-4309-8e18-e26991f92818" alt="" /></div>

<p><a href="http://feedads.g.doubleclick.net/~a/ceuHBhd-VRBI76hFGSrgXx7VmsA/0/da"><img src="http://feedads.g.doubleclick.net/~a/ceuHBhd-VRBI76hFGSrgXx7VmsA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ceuHBhd-VRBI76hFGSrgXx7VmsA/1/da"><img src="http://feedads.g.doubleclick.net/~a/ceuHBhd-VRBI76hFGSrgXx7VmsA/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Prodromus/~4/ps7-X7lLNMs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.prodromus.com/2011/04/15/extjs-jsonwriter-not-respecting-dateformat-used-with-jsonreader/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.prodromus.com/2011/04/15/extjs-jsonwriter-not-respecting-dateformat-used-with-jsonreader</feedburner:origLink></item>
		<item>
		<title>Count number of tables in the database – MySQL</title>
		<link>http://feedproxy.google.com/~r/Prodromus/~3/uMXi97amE_g/count-number-of-tables-in-the-database-mysql</link>
		<comments>http://www.prodromus.com/2011/01/27/count-number-of-tables-in-the-database-mysql#comments</comments>
		<pubDate>Thu, 27 Jan 2011 22:50:10 +0000</pubDate>
		<dc:creator>Prodromus</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Count number of tables in the database]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database name]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql database]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[scheme]]></category>
		<category><![CDATA[Select (SQL)]]></category>
		<category><![CDATA[select count]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[tablename]]></category>

		<guid isPermaLink="false">http://www.prodromus.com/?p=424</guid>
		<description><![CDATA[Determining the number of tables that are contained in a MySQL database is very straight-forward, although it is an often asked question. The simplest way to accomplish this is using the following SQL query. In this query, you will provide the database, and the SQL will access MySQL&#8217;s internal data scheme (information_schema). SELECT count(*) as [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/File:Mysql_architekture_schema.png"><img title="Mysql architekture schema" src="http://www.prodromus.com/wp-content/uploads/2011/01/300px-Mysql_architekture_schema.png" alt="Mysql architekture schema" width="300" height="325" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;"></dd>
</dl>
</div>
</div>
<p>Determining the number of tables that are contained in a MySQL database is very straight-forward, although it is an often asked question.  The simplest way to accomplish this is using the following SQL query.  In this query, you will provide the database, and the SQL will access MySQL&#8217;s internal data scheme (information_schema).</p>
<p>SELECT count(*) as &#8216;Tables&#8217;, table_schema as &#8216;Database&#8217;<br />
FROM information_schema.TABLES<br />
WHERE table_schema= &#8216;The Database Name&#8217;<br />
GROUP BY table_schema</p>
<p>If you need to retrieve this information using PHP, use  can use the following code.  It creates a connection, runs the query, and returns the number of rows retrieved.  This query you notice is slightly different than the one above, often there are multiple ways to get the same result!</p>
<p>$conn = mysql_connect(&#8216;localhost&#8217;, &#8216;USERNAME&#8217;, &#8216;PASSWORD&#8217;, 1, 65536);<br />
$res = mysql_query( &#8220;select table_name from information_schema.tables where table_schema=&#8217;test&#8217;&#8221;, $conn );<br />
echo mysql_num_rows( $res );</p>
<p>And lastly, there is one more way that you can retrieve the number of tables in a database using PHP and the Show Tables command.  In this example, you will need to be connected to a server, and have the database set to the one you are querying against.</p>
<p>echo &#8220;&lt;pre&gt;&#8221;;<br />
$tbl_List = mysql_query(&#8220;SHOW TABLES&#8221;);<br />
$i=0;<br />
while($tables = mysql_tablename($tbl_List,$i))<br />
{</p>
<p>echo $tables;</p>
<p>$i++;<br />
}<br />
echo &#8220;&lt;br /&gt;Table count = $i&#8221;;<br />
echo &#8220;&lt;/pre&gt;&#8221;;</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://www.neuphones.com/2010/12/20/tmobile-comet/">Tmobile Comet</a> (neuphones.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.classic-machines.com/blog/2010/09/07/bell-p-39n-airacobra-little-sir-echo-small-fry">Bell P-39N Airacobra &#8211; Little Sir Echo &#8211; Small Fry</a> (classic-machines.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.classic-machines.com/blog/2010/12/17/topgun-days-by-dave-bio-baranek-the-truth-behind-topgun-and-top-gun">Topgun Days by Dave &#8220;Bio&#8221; Baranek &#8211; The Truth Behind Topgun and Top Gun</a> (classic-machines.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/pixy.gif?x-id=d4453256-cb49-46fb-be44-4c5fd8d2e824" alt="" /></div>

<p><a href="http://feedads.g.doubleclick.net/~a/kEYDBZwuTgEVWipYZflUbpGtlTY/0/da"><img src="http://feedads.g.doubleclick.net/~a/kEYDBZwuTgEVWipYZflUbpGtlTY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/kEYDBZwuTgEVWipYZflUbpGtlTY/1/da"><img src="http://feedads.g.doubleclick.net/~a/kEYDBZwuTgEVWipYZflUbpGtlTY/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Prodromus/~4/uMXi97amE_g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.prodromus.com/2011/01/27/count-number-of-tables-in-the-database-mysql/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.prodromus.com/2011/01/27/count-number-of-tables-in-the-database-mysql</feedburner:origLink></item>
		<item>
		<title>What database does Facebook use?</title>
		<link>http://feedproxy.google.com/~r/Prodromus/~3/Bt7eWAEJ4Kk/what-database-does-facebook-use</link>
		<comments>http://www.prodromus.com/2011/01/27/what-database-does-facebook-use#comments</comments>
		<pubDate>Thu, 27 Jan 2011 22:19:41 +0000</pubDate>
		<dc:creator>Prodromus</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[caching system]]></category>
		<category><![CDATA[database engine]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Innodb]]></category>
		<category><![CDATA[large scale web applications]]></category>
		<category><![CDATA[Memcached]]></category>
		<category><![CDATA[Microsoft SQL Server]]></category>
		<category><![CDATA[mysql servers]]></category>
		<category><![CDATA[NFS]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[What database does Facebook use?]]></category>

		<guid isPermaLink="false">http://www.prodromus.com/?p=417</guid>
		<description><![CDATA[What database does Facebook use is one of the most common questions asked when folks start taking about what database is the most scalable for large scale web applications.   In fact, it is usually a person who is an open source proponent, and knows very well that Facebook uses MySQL as their core database [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/File:Mysqlwb-homepage.png"><img title="The home screen of the FOSS edition of MySQL W..." src="http://www.prodromus.com/wp-content/uploads/2011/01/300px-Mysqlwb-homepage2.png" alt="The home screen of the FOSS edition of MySQL W..." width="300" height="211" /></a></dt>
</dl>
</div>
</div>
<p>What database does <a class="zem_slink" title="Facebook" rel="homepage" href="http://facebook.com">Facebook</a> use is one of the most common questions asked when folks start taking about what database is the most scalable for large scale web applications.   In fact, it is usually a person who is an open source proponent, and knows very well that Facebook uses <a class="zem_slink" title="MySQL" rel="homepage" href="http://www.mysql.com">MySQL</a> as their core database engine.  Because of this fact, this is often the single biggest reason that developers use to push to get MySQL used in their company.  I would imagine that is why it is a very popular Google query.</p>
<p>While Facebook uses MySQL, they do not use it as-is out of the box.  In fact, their team has submitted numerous high-performance enhancements to the MySQL core and <a class="zem_slink" title="InnoDB" rel="homepage" href="http://www.innodb.com/">Innodb</a> plug-in.  Their main focus has been on adding performance counters to Innodb.  Other changes focused on the IO sub-system, including the following new features :</p>
<ul>
<li>innodb_io_capacity &#8211; sets the IO capacity of the server to determine rate limits for background IO</li>
<li>innodb_read_io_threads, innodb_write_io_threads &#8211; set the number of background IO threads</li>
<li>innodb_max_merged_io &#8211; sets the maximum number of adjacent IO requests that may be merged into a large IO request</li>
</ul>
<p>Facebook uses MySQL as a key-value store in which data is randomly distributed across a large set of logical instances. These logical instances are spread out across physical nodes and load balancing is done at the physical node level.  Facebook has developed a partitioning scheme in which a global ID is assigned to all user data. They also have a custom archiving scheme that is based on how frequent and recent data is on a per-user basis. Most data is distributed randomly.  Amazingly, it has been rumored that Facebook has 1800 MySQL servers, but only 3 full-time DBAs.</p>
<p>Facebook primarily uses MySQL for structured data storage such as wall posts, user information, etc. This data is replicated between their various data centers. For blob storage (photos, video, etc.), Facebook makes use of a custom solution that involves a CDN externally and NFS internally.</p>
<p>It is also important to note that Facebook makes heavy use of Memcache,  a memory caching system that is used to speed up dynamic database-driven websites by caching data and objects in RAM to reduce reading time. Memcache is Facebook’s primary form of caching and greatly reduces the database load. Having a caching system allows Facebook to be as fast as it is at recalling your data. If it doesn’t have to go to the database it will just fetch your data from the cache based on your user ID.</p>
<p>So, while &#8220;What database does Facebook use?&#8221; seems like a simple question, you can see that they have added a variety of other systems to make it truly web scalable.  But, still feel free to use the argument, &#8220;MySQL is as good or better than Oracle or MS SQL Server, heck, even Facebook uses it, and they have 500 Million users!&#8221;.</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://www.allfacebook.com/facebook-showcasing-its-open-source-database-2010-11">Facebook Showcasing Its Open Source Database</a> (allfacebook.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.z-car.com/blog/2010/12/10/google-chromes-new-false-start-feature">Google Chrome&#8217;s new False Start &#8220;Feature&#8221;</a> (z-car.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.readwriteweb.com/hack/2010/11/facebook-mysql-scale.php">Video: How Facebook Makes MySQL Scale</a> (readwriteweb.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/pixy.gif?x-id=81737e68-599c-4886-b9d3-1656464a5293" alt="" /></div>

<p><a href="http://feedads.g.doubleclick.net/~a/zWhQ3Q2MAe2ehIKWi-7ARPDa8HI/0/da"><img src="http://feedads.g.doubleclick.net/~a/zWhQ3Q2MAe2ehIKWi-7ARPDa8HI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/zWhQ3Q2MAe2ehIKWi-7ARPDa8HI/1/da"><img src="http://feedads.g.doubleclick.net/~a/zWhQ3Q2MAe2ehIKWi-7ARPDa8HI/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Prodromus/~4/Bt7eWAEJ4Kk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.prodromus.com/2011/01/27/what-database-does-facebook-use/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.prodromus.com/2011/01/27/what-database-does-facebook-use</feedburner:origLink></item>
		<item>
		<title>MySQL – ORDER BY does not sort data properly…</title>
		<link>http://feedproxy.google.com/~r/Prodromus/~3/tYUkokSlXok/mysql-order-by-does-not-sort-data-properly</link>
		<comments>http://www.prodromus.com/2010/12/28/mysql-order-by-does-not-sort-data-properly#comments</comments>
		<pubDate>Tue, 28 Dec 2010 22:24:16 +0000</pubDate>
		<dc:creator>Prodromus</dc:creator>
				<category><![CDATA[Errors]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Optimization]]></category>
		<category><![CDATA[Enigma]]></category>
		<category><![CDATA[enum]]></category>
		<category><![CDATA[ORDER]]></category>
		<category><![CDATA[order by]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[Select]]></category>
		<category><![CDATA[simple queries]]></category>
		<category><![CDATA[sort]]></category>
		<category><![CDATA[sort broken]]></category>
		<category><![CDATA[table structure]]></category>
		<category><![CDATA[undiscovered]]></category>

		<guid isPermaLink="false">http://www.prodromus.com/?p=408</guid>
		<description><![CDATA[Imagine a developer working late at night trying to complete some simple queries for a report due the next day.  No matter what she does, the resulting query will just not sort properly. Is this some undiscovered MySQL bug?  No wonder this software is free, MySQL is broke and can&#8217;t even perform a basic sort. [...]]]></description>
			<content:encoded><![CDATA[<p>Imagine a developer working late at night trying to complete some simple queries for a report due the next day.  No matter what she does, the resulting query will just not sort properly. Is this some undiscovered MySQL bug?  No wonder this software is free, MySQL is broke and can&#8217;t even perform a basic sort.  It looks simple, sort the data in a table:</p>
<p>mysql&gt; SELECT id, technology from Enigma;<br />
+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+<br />
| Id | technology |<br />
+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+<br />
| 1 | PHP |<br />
| 2 | LINUX |<br />
| 3 | MySQL |<br />
+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+</p>
<p>To sort the records based on the technology, do an ORDER BY on column Technology:</p>
<p>mysql&gt; SELECT id, technology from Enigma ORDER BY Technology;<br />
+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+<br />
| Id | technology |<br />
+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+<br />
| 1 | PHP |<br />
| 2 | LINUX |<br />
| 3 | MySQL |<br />
+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+</p>
<p>It seems that the server does not understand what I have asked, or I have not mastered the entire alphabet &#8230;<br />
Let&#8217;s add the clause CSA (just in case!)</p>
<p>mysql&gt; SELECT id, technology from Enigma ORDER BY ASC Technology;<br />
+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+<br />
| Id | technology |<br />
+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+<br />
| 1 | PHP |<br />
| 2 | LINUX |<br />
| 3 | MySQL |<br />
+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+</p>
<p>That does not seem to be any better!  MySQL does not sort the data as I wish, am I going crazy? Should I change my RDBMS?<br />
Don&#8217;t worry, a careful look at the table structure allows us to see things clearly.</p>
<p>mysql&gt; SHOW CREATE TABLE enigma;</p>
<p>Table: enigma<br />
Create Table: CREATE TABLE `Enigma` (<br />
`Id` int (11) DEFAULT NULL,<br />
`Technology` enum (&#8216;PHP&#8217;, &#8216;Linux&#8217;, &#8216;MySQL&#8217;) DEFAULT NULL<br />
) ENGINE = MyISAM DEFAULT CHARSET = latin1</p>
<p>The column technology is of a type ENUM.  The Enum field is stored as an integer, and that is the index that MySQL uses for sorting.  In other words, 1 is PHP, 3 is MySQL, and 2 is Linux, so sorting does works properly, just not as expected when the Enum data field is storing character data.  So how do you get the desired result?  Simply force MySQL to use the value string and not index when sorting.   This can be done by using either the Concat() or Cast() functions, as follows:</p>
<p>function concat ()<br />
mysql&gt; SELECT id, technology from Enigma ORDER BY concat (technology);<br />
+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+<br />
| Id | technology |<br />
+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+<br />
| 2 | LINUX |<br />
| 3 | MySQL |<br />
| 1 | PHP |<br />
+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+<br />
function cast ()<br />
mysql&gt; SELECT id, technology from Enigma ORDER BY cast (technology as char);<br />
<span style="font-size: 11.6667px;">+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+<br />
| id | Technology |<br />
+&#8212;&#8211; -+&#8212;&#8212;&#8212;&#8212;-+<br />
| 2 | LINUX |<br />
| 3 | MySQL |<br />
| 1 | PHP |<br />
+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8211; &#8211; +</span></p>

<p><a href="http://feedads.g.doubleclick.net/~a/_BriufLUcSZVYukOXE2ws_uXKHQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/_BriufLUcSZVYukOXE2ws_uXKHQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/_BriufLUcSZVYukOXE2ws_uXKHQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/_BriufLUcSZVYukOXE2ws_uXKHQ/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Prodromus/~4/tYUkokSlXok" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.prodromus.com/2010/12/28/mysql-order-by-does-not-sort-data-properly/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.prodromus.com/2010/12/28/mysql-order-by-does-not-sort-data-properly</feedburner:origLink></item>
		<item>
		<title>MySQL – A simple script to truncate all MySQL tables in a Database</title>
		<link>http://feedproxy.google.com/~r/Prodromus/~3/UuI_r_5PGgc/mysql-a-simple-script-to-truncate-all-mysql-tables-in-a-database</link>
		<comments>http://www.prodromus.com/2010/12/22/mysql-a-simple-script-to-truncate-all-mysql-tables-in-a-database#comments</comments>
		<pubDate>Wed, 22 Dec 2010 20:50:32 +0000</pubDate>
		<dc:creator>Prodromus</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Dirty]]></category>
		<category><![CDATA[DROP]]></category>
		<category><![CDATA[Dump]]></category>
		<category><![CDATA[dumpfile]]></category>
		<category><![CDATA[mysql stored procedure]]></category>
		<category><![CDATA[mysql tables]]></category>
		<category><![CDATA[mysqldump]]></category>
		<category><![CDATA[Percona]]></category>
		<category><![CDATA[procedure]]></category>
		<category><![CDATA[recovery]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Stored]]></category>
		<category><![CDATA[Stored procedure]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[table statements]]></category>
		<category><![CDATA[TRUNCATE]]></category>

		<guid isPermaLink="false">http://www.prodromus.com/?p=359</guid>
		<description><![CDATA[Want a quick and dirty way to Truncate all the tables in a MySQL DB?  You can use the following one line script. mysqldump -ppassword YourDBName &#8211;no-data dumpfile &#124; mysql dumpfile What this does is uses mysqldump to output all the tables in the database &#8220;YourDBName&#8221; into a dump file.  This dump file contains drop [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 210px;">
<dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/File:Mysql-hires.gif"><img title="The official logo of the database query MySQL" src="http://www.prodromus.com/wp-content/uploads/2010/12/Mysql-hires.gif" alt="The official logo of the database query MySQL" width="200" height="103" /></a></dt>
</dl>
</div>
</div>
<p>Want a quick and dirty way to Truncate all the tables in a MySQL DB?  You can use the following one line script.</p>
<p>mysqldump -ppassword YourDBName &#8211;no-data dumpfile | mysql dumpfile</p>
<p>What this does is uses mysqldump to output all the tables in the database &#8220;YourDBName&#8221; into a dump file.  This dump file contains drop statements, and create table statements for each table in the database.  What this effectively does is drops every table, and recreates it WITHOUT any data inside.  Be very careful, since this is a very powerful script, it has the ability to completely wipe out your database with no hope of recovery unless you have a current backup.</p>
<p>For additional ways to execute specific commands against all tables in a DB, look into using <a rel="nofollow" href="http://www.maatkit.org/doc/mk-find.html">mk-find</a> in <a rel="nofollow" href="http://www.maatkit.org/tools.html">Maatkit</a>, it is an excellent tool for advanced MySQL scripting.</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://www.prodromus.com/2010/12/17/exiting-a-mysql-stored-procedure-in-the-middle-of-the-code">Exiting a MySQL Stored Procedure in the middle of the code</a> (prodromus.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.mysqlperformanceblog.com/2010/12/21/mysql-5-5-8-and-percona-server-on-fast-flash-card-virident-tachion/">MySQL 5.5.8 and Percona Server on Fast Flash card (Virident tachIOn)</a> (mysqlperformanceblog.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/pixy.gif?x-id=44ce1fc5-a3f7-47c0-8a39-c9db0470b6ad" alt="" /></div>

<p><a href="http://feedads.g.doubleclick.net/~a/OqCOvTpprGrLTNuml7rc2mxUm6A/0/da"><img src="http://feedads.g.doubleclick.net/~a/OqCOvTpprGrLTNuml7rc2mxUm6A/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/OqCOvTpprGrLTNuml7rc2mxUm6A/1/da"><img src="http://feedads.g.doubleclick.net/~a/OqCOvTpprGrLTNuml7rc2mxUm6A/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Prodromus/~4/UuI_r_5PGgc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.prodromus.com/2010/12/22/mysql-a-simple-script-to-truncate-all-mysql-tables-in-a-database/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.prodromus.com/2010/12/22/mysql-a-simple-script-to-truncate-all-mysql-tables-in-a-database</feedburner:origLink></item>
		<item>
		<title>MySQL – Select rows from a table when a field starts with a number</title>
		<link>http://feedproxy.google.com/~r/Prodromus/~3/5DV4AAu-vko/mysql-select-rows-from-a-table-when-a-field-starts-with-a-number</link>
		<comments>http://www.prodromus.com/2010/12/22/mysql-select-rows-from-a-table-when-a-field-starts-with-a-number#comments</comments>
		<pubDate>Wed, 22 Dec 2010 19:33:46 +0000</pubDate>
		<dc:creator>Prodromus</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Query Optimization]]></category>
		<category><![CDATA[character class]]></category>
		<category><![CDATA[Pattern matching]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[Regular expression]]></category>
		<category><![CDATA[Select]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://www.prodromus.com/?p=353</guid>
		<description><![CDATA[A common request is how to select records from a table when a specific field starts with a number. This request often is used when searching free-form text fields where the fields were used to provide an answer field to a question. The simplest way to attack this is by using a regular expression. For [...]]]></description>
			<content:encoded><![CDATA[<p>A common request is how to select records from a table when a specific field starts with a number.  This request often is used when searching free-form text fields where the fields were used to provide an answer field to a question.</p>
<p>The simplest way to attack this is by using a regular expression.  For example:</p>
<p>SELECT * FROM BadlyDesignedTable WHERE AnswerColumn regexp &#8216;^[0-9]+&#8217;;</p>
<p>or<br />
SELECT * FROM BadlyDesignedTable WHERE AnswerColumn RLIKE &#8216;^[0-9]+&#8217;;</p>
<p><a class="zem_slink" title="Regular expression" rel="wikipedia" href="http://en.wikipedia.org/wiki/Regular_expression">Regex</a> and RLIKE are compatible keywords that both represent regular expression matching.</p>
<p>The regex is described as follows :</p>
<p>^    - Start anchor, used to ensure the <a class="zem_slink" title="Pattern matching" rel="wikipedia" href="http://en.wikipedia.org/wiki/Pattern_matching">pattern matches</a> start of the string.<br />
[    - Start of <a class="zem_slink" title="Character class" rel="wikipedia" href="http://en.wikipedia.org/wiki/Character_class">character class</a>.<br />
0-9  - Any digit<br />
]    - End of character class</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://ask.metafilter.com/173434/How-can-I-select-this-in-SQL">How can I select this in SQL?</a> (ask.metafilter.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.mt-soft.com.ar/2010/07/19/test-regular-expressions-in-your-browser/">Test Regular Expressions in Your Browser</a> (mt-soft.com.ar)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/pixy.gif?x-id=12bfbaa8-f424-4e31-82c2-084467a3e4ea" alt="" /></div>

<p><a href="http://feedads.g.doubleclick.net/~a/53IEE1FW_BG3LLZ-ExRcxdzXG8o/0/da"><img src="http://feedads.g.doubleclick.net/~a/53IEE1FW_BG3LLZ-ExRcxdzXG8o/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/53IEE1FW_BG3LLZ-ExRcxdzXG8o/1/da"><img src="http://feedads.g.doubleclick.net/~a/53IEE1FW_BG3LLZ-ExRcxdzXG8o/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Prodromus/~4/5DV4AAu-vko" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.prodromus.com/2010/12/22/mysql-select-rows-from-a-table-when-a-field-starts-with-a-number/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.prodromus.com/2010/12/22/mysql-select-rows-from-a-table-when-a-field-starts-with-a-number</feedburner:origLink></item>
		<item>
		<title>Exiting a MySQL Stored Procedure in the middle of the code</title>
		<link>http://feedproxy.google.com/~r/Prodromus/~3/nqgb0UfjjG8/exiting-a-mysql-stored-procedure-in-the-middle-of-the-code</link>
		<comments>http://www.prodromus.com/2010/12/17/exiting-a-mysql-stored-procedure-in-the-middle-of-the-code#comments</comments>
		<pubDate>Fri, 17 Dec 2010 18:50:23 +0000</pubDate>
		<dc:creator>Prodromus</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[EXIT]]></category>
		<category><![CDATA[Exit a Stored Procedure]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[How to Exit a Mysql Stored Procedure]]></category>
		<category><![CDATA[LEAVE]]></category>
		<category><![CDATA[mysql stored procedure]]></category>
		<category><![CDATA[procedure]]></category>
		<category><![CDATA[Statement]]></category>
		<category><![CDATA[Stored]]></category>
		<category><![CDATA[Stored procedure]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://www.prodromus.com/?p=350</guid>
		<description><![CDATA[While exiting a MySQL function is fairly straight-forward, simply use the RETURN keyword, exiting a Stored Procedure is not quite as obvious.  There is no EXIT keyword, however you can use the LEAVE keyword and specify a label that is associated with the BEGIN of the Stored Procedure.  In this way, you are defining the [...]]]></description>
			<content:encoded><![CDATA[<p>While exiting a MySQL function is fairly straight-forward, simply use the RETURN keyword, exiting a Stored Procedure is not quite as obvious.  There is no EXIT keyword, however you can use the LEAVE keyword and specify a label that is associated with the BEGIN of the Stored Procedure.  In this way, you are defining the Stored Procedure with a Label, which the LEAVE statement can then act upon.</p>
<p>As an example, look at the following Stored Procedure :</p>
<p>CREATE PROCEDURE TestProc(Value INT)</p>
<p>ThisSP:BEGIN</p>
<p>IF  Value is null or Value=0 then<br />
Select &#8216;Invalid Value&#8217;;<br />
LEAVE ThisSP;<br />
END IF;</p>
<p>Select * from Table twhere t.Value=Value;</p>
<p><span style="font-size: 11.6667px;">END;</span></p>

<p><a href="http://feedads.g.doubleclick.net/~a/oaVcmRnJhtiheukaQK7BsNVtVmc/0/da"><img src="http://feedads.g.doubleclick.net/~a/oaVcmRnJhtiheukaQK7BsNVtVmc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/oaVcmRnJhtiheukaQK7BsNVtVmc/1/da"><img src="http://feedads.g.doubleclick.net/~a/oaVcmRnJhtiheukaQK7BsNVtVmc/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Prodromus/~4/nqgb0UfjjG8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.prodromus.com/2010/12/17/exiting-a-mysql-stored-procedure-in-the-middle-of-the-code/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.prodromus.com/2010/12/17/exiting-a-mysql-stored-procedure-in-the-middle-of-the-code</feedburner:origLink></item>
	</channel>
</rss>

