<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>RSS feed for InstantSpot site Mark Brown&apos;s Blog</title><link>http://markbrown.instantspot.com</link><description>Adventures of a ColdFusion Newbie</description><language>en-us</language><copyright>This work is Copyright &#xA9; 2009 by Mark Brown&apos;s Blog</copyright><generator>RSSVille ColdFusion FeedMaker, version 1.0</generator><pubDate>Sat, 07 Nov 2009 14:10:27 GMT</pubDate><item><title>How to convert date format&apos;s in MySQL.</title><link>http://markbrown.instantspot.com/blog/2007/04/30/How-to-convert-date-formats-in-MySQL</link><description>&lt;p&gt;  As you can see in my Blog entry on &lt;a href=&quot;http://markbrown.instantspot.com/blog/index.cfm/2007/4/27/How-to-import-Microsoft-Access-database-into-MySql&quot;&gt;how to import a Microsoft Access Database to MySQL&lt;/a&gt; , I ran into a small problem on converting all the dates from the format of mm/dd/yyyy to MySQL Date Format of yyyy-mm-dd.  &lt;/p&gt;  &lt;p&gt;  Thanks to all the help I recieved from Guelphad on the MySQL Newbie forum in&lt;a href=&quot;http://forums.mysql.com/read.php?10,147632,147632#msg-147632&quot;&gt; this post,&lt;/a&gt;  I got all the dates converted and am good shape.   &lt;/p&gt;  &lt;p&gt;  &amp;nbsp;Here&amp;#39;s how I converted the date formats on Guedlphad&amp;#39;s Advice.  &lt;/p&gt;  &lt;p&gt;  &amp;nbsp;In my table(misequip) , I created a new column with a data type of DATE with a name (dt_deployed) similar to the column that contained my dates imported from Access (date_deployed) in string format.&amp;nbsp; If you&amp;#39;ll remember, I imported all the dates as a datatype of VARCHAR just to get them into the database.  &lt;/p&gt;  &lt;p&gt;  I then ran this command:  &lt;/p&gt;  &lt;p style=&quot;background-color: #ccff00&quot;&gt;  &lt;font color=&quot;#000000&quot;&gt;mysql&amp;gt; UPDATE misequip SET dt_deployed =&amp;nbsp; str_to_date(date_deployed, &amp;#39;%m/%d/%Y&amp;#39;);&lt;/font&gt;  &lt;/p&gt;  &lt;p&gt;  What that command does is UPDATE&amp;#39;s the misequip table, SET&amp;#39;s the new column dt_deployed to equal the out put of the &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_str-to-date&quot;&gt;MySQL function STR_TO_DATE &lt;/a&gt; that converts Strings to Dates.   &lt;/p&gt;  &lt;p&gt;  Once I ran this command, I looked at the my database and all the dates were converted.&amp;nbsp; Worked like a champ.&amp;nbsp; I then dropped my original column, then renamed my new column to match the old name, date_deployed.  &lt;/p&gt;  &lt;p&gt;  &amp;nbsp;We will now be albe to do calculations on these dates now since they are in DATE format to figure out when warranties expire and stuff like that.   &lt;/p&gt;  &lt;p&gt;  &amp;nbsp;Hope this help some of you newbieMySQL guys out there,  &lt;/p&gt;  &lt;p&gt;  Mark &lt;br /&gt;  &lt;/p&gt;  &lt;p&gt;  &amp;nbsp;  &lt;/p&gt;  &lt;p&gt;  &amp;nbsp;&amp;nbsp;  &lt;/p&gt;  </description><pubDate>Mon, 30 Apr 2007 15:42:28 GMT</pubDate><guid>http://markbrown.instantspot.com/blog/2007/04/30/How-to-convert-date-formats-in-MySQL</guid><category>Databases</category></item><item><title>How to import Microsoft Access database into MySql</title><link>http://markbrown.instantspot.com/blog/2007/04/27/How-to-import-Microsoft-Access-database-into-MySql</link><description>&lt;!--  @page { size: 8.5in 11in; margin: 0.79in }  P { margin-bottom: 0.08in }  --&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  I&amp;#39;m working on web enabling my  inventory of IT Equipment with ColdFusion and MySql.  The database is  an Access database that is pretty simple, just name, model number,  date of purchase, blah, blah, blah.    &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  &lt;br /&gt;  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  The first thing I&amp;#39;ve had to do to get  this accomplished is to export my Access database as a tab delimited  text file.  In Access, under the File menu, I went to Export. That  opened the Export Wizard. I gave the file a name &amp;quot;inv.tab&amp;quot;,  then on the first screen of that Wizard I choose delimited,  on the  second screen of the wizard choose &amp;quot;Tab&amp;quot;, then set the  &amp;quot;Text Qualifier&amp;quot; option to &amp;quot;None&amp;quot;.  Set a  location for the exported file to reside, then clicked the Finish  button.  Upon confirmation of the successful export, I opened the  text file I created with Access with a text editor (gEdit in Linux,  Notepad in Windows) and looked at the file to make sure that all the  columns and data looked ok.  I&amp;#39;ve got 3 date columns in the database,  and noticed that behind each date was a time and that the date format  was wrong and wouldn&amp;#39;t work in MySql.  (We&amp;#39;ll tackle the date problem  in another post as I haven&amp;#39;t figure out how to convert them all to  the proper date format for MySql without touching each date by hand)   Anyway, I did a find and replace and replaced all the times in the  file with a space. This application I only need the dates.  I  verified that all the times were gone, then saved the file.  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  &lt;br /&gt;  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  &lt;br /&gt;  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  Then I connected to MySql via the  command line client and &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/database-use.html&quot;&gt;create  my database&lt;/a&gt; and  &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/creating-tables.html&quot;&gt;created  my tables&lt;/a&gt; to include all the columns to match the columns in my  Access database.  On the three date fields, I set them up with data  types of VARCHAR(20). For now as I&amp;#39;m just wanting to get the data in  the database. I also made all the columns to allow NULL&amp;#39;s except the  Primary Key. I&amp;#39;m working with some people on the MySql newbie forum  to get &lt;a href=&quot;http://forums.mysql.com/read.php?10,147632,150838#msg-150838&quot;&gt;help  on converting&lt;/a&gt; the dates to the correct format.  There is a MySql  function STR_TO_DATE that will convert strings to dates in the  correct format.  I&amp;#39;m hoping that will help me convert all the dates  at once.   &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  &lt;br /&gt;  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  Once the table was created, and the  export files was checked, I started my first import by using the &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/loading-tables.html&quot;&gt;LOAD  &lt;/a&gt;command in MySql.  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  &lt;br /&gt;  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  I copied one record from the export  file (inv.tab) into a new file (test.tab) and ran a test on it to  make sure it would import the file in the correct columns.  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  &lt;br /&gt;  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  Then, in the MySQL Command line client,  I imported my test file (test.tab) with this command  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  &lt;br /&gt;  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  mysql&amp;gt;LOAD DATA LOCAL INFILE  &amp;#39;/home/mbrown/test.tab&amp;#39; INTO TABLE misequip;  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  &lt;br /&gt;  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  Much to my amazement it ran without  error.  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  &lt;br /&gt;  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  so I did a mysql&amp;gt;SELECT * FROM  misequip;  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  &lt;br /&gt;  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  Sure enough, there was my data.  Cool.   So, now I tried the big file.  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  &lt;br /&gt;  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  I opened the inv.tab export file, made  sure the line I already imported was gone, then type this:  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  &lt;br /&gt;  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  mysql&amp;gt;LOAD DATA LOCAL INFILE  &amp;#39;/home/mbrown/inv.tab&amp;#39; INTO TABLE misequip;  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  &lt;br /&gt;  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  No errors again.  Cool!  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  &lt;br /&gt;  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  Then I did a mysql&amp;gt;SELECT * from  misequip; and BOOM, there&amp;#39;s all my data!  SWEEETTTT!  I love MySql!   LOL  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  &lt;br /&gt;  &lt;/p&gt;  &lt;p style=&quot;margin-bottom: 0in&quot;&gt;  Now I&amp;#39;m going to tackle the date  convert thing.  I&amp;#39;ll keep you posted.  &lt;/p&gt;  </description><pubDate>Fri, 27 Apr 2007 15:49:12 GMT</pubDate><guid>http://markbrown.instantspot.com/blog/2007/04/27/How-to-import-Microsoft-Access-database-into-MySql</guid><category>Databases</category></item><item><title>First Experiences with MySql</title><link>http://markbrown.instantspot.com/blog/2007/03/28/First-Experiences-with-MySql</link><description>&lt;p&gt;  I&amp;#39;ve been playing with &lt;a href=&quot;http://www.mysql.com&quot;&gt;MySql &lt;/a&gt; a bit lately and have to say I&amp;#39;m impressed.  To me this is a product of the Open Source world that really shows the benefits of Open Source software, especially in the documentation.  &lt;br /&gt;  &lt;/p&gt;  &lt;p&gt;  I&amp;#39;ve really just been playing with it, so I don&amp;#39;t have any highly technical revelations to report yet, but what really has impressed me so far is the documentation that comes with it in the help file.  You can find it on there web site &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/index.html&quot;&gt;here&lt;/a&gt; .  For a noob like me the tutorial in that documentation is invaluable.  Very simple, easy step by step examples on creating your first database, table, and getting data into and out of it.    &lt;/p&gt;  &lt;p&gt;  &lt;a href=&quot;http://ajlcom.instantspot.com/&quot;&gt;  Aaron Lynch&lt;/a&gt; , &lt;a href=&quot;http://daveshuck.instantspot.com&quot;&gt;Dave Shuck&lt;/a&gt;  and  &lt;a href=&quot;http://musetracks.instantspot.com/&quot;&gt;Rob Wilkerson&lt;/a&gt;  all encouraged me to check it out and initially I&amp;#39;m glad I took their advise.  Thanks fella&amp;#39;s.   &lt;/p&gt;  </description><pubDate>Wed, 28 Mar 2007 14:25:45 GMT</pubDate><guid>http://markbrown.instantspot.com/blog/2007/03/28/First-Experiences-with-MySql</guid><category>Databases</category></item><item><title>Database preferences and opinions.</title><link>http://markbrown.instantspot.com/blog/2007/03/22/Database-preferences-and-opinions</link><description>&lt;p&gt;  So, this is probably one of those loaded questions like asking if a group of Nascar Fans likes Ford or Chevy better, but here it comes anyway.  Well, after a bit of explanation as to why I&amp;#39;m asking such a question anyway.   &lt;/p&gt;  &lt;p&gt;  Being a newbie to CF development and databases I tend to lean towards simplicity.  My background as a IT Manager hasn&amp;#39;t gotten me very much experience with the big server based DB&amp;#39;s like MSSQL and MySql.  In the past, if we&amp;#39;ve needed &amp;quot;hardcore&amp;quot; db work done by boss tells me to hire a &amp;quot;SQL Guy&amp;quot;.  So I haven&amp;#39;t learned to much about the inner workings of the different server based DB&amp;#39;s.   &lt;/p&gt;  &lt;p&gt;  When I started learning ColdFusion I found working with MS Access db&amp;#39;s very simple.  Easy to setup, easy to edit and easy to muddle thru setting up my first one to many relationships.  As far as I can tell Access will do what ever I want or need it to.  Hopefully some day I&amp;#39;ll have to worry about the limitations of Access, but up until now I was just looking for simplicity.  Learning ColdFusion is enough to keep me busy, but I would really like to move over to Ubuntu Full time.  (I&amp;#39;ll explain why in another yet to come blog entry) But moving to Ubuntu, or any distro of linux makes me look at another db as an option, and of course that leads me to MySql.   &lt;/p&gt;  &lt;p&gt;  I&amp;#39;ve found a couple of good tutorials and the the documentation on MySql&amp;#39;s site is pretty good.  It seams easy enough to learn.  But I&amp;#39;m curious as to a couple of things:  &lt;/p&gt;  &lt;p&gt;  In your all&amp;#39;s opinion....   &lt;/p&gt;  &lt;p&gt;  1.  What are the advantages or disadvantages to using MySql for your ColdFusion datasourse?  &lt;/p&gt;  &lt;p&gt;  2.  What are the advantages or disadvantages of using MySql over MS Access, MSSql, or any other popular db?  Windows or not.   &lt;/p&gt;  &lt;p&gt;  3. It seems like most hosting companies support MySql.  Do you find that that support is generally pretty good?   &lt;/p&gt;  &lt;p&gt;  4.  For a newbie like me, is this just going to &amp;quot;muddy&amp;quot; the overall learning waters for my new found love of web app. development?    &lt;/p&gt;  &lt;p&gt;  5. Should I just stick with Windows and the initial easy of use and quick configuration to get my budding ColdFusion career going?&lt;br /&gt;  &lt;/p&gt;  &lt;p&gt;  Ohh, such deep thoughts and questions...LOL.  &lt;/p&gt;  &lt;p&gt;  Can&amp;#39;t wait to read you all&amp;#39;s advice.  &lt;/p&gt;  &lt;p&gt;  Later,  &lt;/p&gt;  &lt;p&gt;  Mark   &lt;/p&gt;  </description><pubDate>Thu, 22 Mar 2007 19:56:20 GMT</pubDate><guid>http://markbrown.instantspot.com/blog/2007/03/22/Database-preferences-and-opinions</guid><category>Databases</category></item><item><title>CF Newbieness and Hello</title><link>http://markbrown.instantspot.com/blog/2006/10/11/CF-Newbieness-and-Hello</link><description>&lt;p&gt;  Well, Hello.  My name is Mark Brown.  This is my first blog, so bear with me.    &lt;/p&gt;  &lt;p&gt;  &amp;nbsp;  &lt;/p&gt;  &lt;p&gt;  I decided to start this thing because I&amp;#39;m learning some new skills.  I&amp;#39;m a IT Manager, and am very familiar with pc&amp;#39;s, servers, networks, blah, blah, blah.  It dawned on me a few months ago that I needed to learn some new skills.  On the advice from a friend, Mike,  I decieded to learn Web Application Programming using ColdFusion.  So, I figured, that sounds easy enough, and started.  First problem I ran into was, I HAVE NO PROGAMMING EXPERIENCE.  None.  Ziltch. Nada.  I&amp;#39;ve written a few batch scripts for login scripts on my Novell servers at work, but other than that I was clueless.  Well, I&amp;#39;m still clueless, but an learning more by the day.  You web programmers talk your own language.  I&amp;#39;m Starting to understand some of it, but hey, life is just one big learning curve. Right?   &lt;/p&gt;  &lt;p&gt;  &amp;nbsp;  &lt;/p&gt;  &lt;p&gt;  Anyway, I&amp;#39;m about 6 months into it.  I haven&amp;#39;t been hitting it too hard, but have learned quite a bit.  About a month ago I launched my family website, http://www.thebrownhomeonline.com.  I did it with Coldfusion and it seemed fairly straight forward.  It&amp;#39;s got a private section that took me a while to figure out how to do the security, and the initial learning about frameworks to keep the maintenance of it easy were a bit difficult for me, but I eventually got it with some very generous help from Mike.  &lt;/p&gt;  &lt;p&gt;  &amp;nbsp;  &lt;/p&gt;  &lt;p&gt;  I&amp;#39;ve got a couple other projects I&amp;#39;m working on, which I&amp;#39;ll talk about later.    &lt;/p&gt;  &lt;p&gt;  &amp;nbsp;  &lt;/p&gt;  &lt;p&gt;  Main reason for this blog entry is just to Introduce myself, and give you all a idea of what to expect from this blog.    &lt;/p&gt;  &lt;p&gt;  &amp;nbsp;  &lt;/p&gt;  &lt;p&gt;  What I&amp;#39;m hoping to accomplish here is to document my journey from total cluelessness in ColdFusion and web apps to my finished products.  I hope to be able to help other newbies find good resources I&amp;#39;ve used, and/or document some of the hurdles I ran into throughout this process and how I overcame them.  You&amp;#39;ll probably also get to see some of my rants and raves on wide variety of subjects.  Lucky YOU!!!  &lt;/p&gt;  &lt;p&gt;  &amp;nbsp;  &lt;/p&gt;  &lt;p&gt;  So, there you have it.    &lt;/p&gt;  &lt;p&gt;  &amp;nbsp;  &lt;/p&gt;  &lt;p&gt;  Later,  &lt;/p&gt;  &lt;p&gt;  Mark   &lt;/p&gt;  </description><pubDate>Wed, 11 Oct 2006 13:42:07 GMT</pubDate><guid>http://markbrown.instantspot.com/blog/2006/10/11/CF-Newbieness-and-Hello</guid></item></channel></rss>