www.zeroonezero.com

Altering all tables in the database

Thursday, May 15th, 2008

So today I was doing some thinking about my next project, and I decided that I should not be deleting records willy nilly and instead using a flag for deletion.  I know, I’m a little behind the times, this is certainly basic database management, but you know how things are.  We do what we do because we learned our bad habits from programmers before us.  The bigger picture is, experience and reading peer materials (best practices blogs and websites) teach us how to think differently, and how to correct some of our bad habits.  As one who is always interested in correcting those bad habits, I came across a nifty solution.

Using the mysql Show Tables syntax in a ColdFusion cfquery, I am able to pull down a query result set of all of the tables within the database that I am working on.  Using that query is very simple then to loop over and conduct a new query that alters the tables, adding on the new column that I wanted.

<CFQUERY NAME=”test” datasource=”#dsn#” username=”#dbuser#” password=”#dbpass#”>    
  show tables;
</CFQUERY>

The query will output with a column named TABLES_IN_xxxxx where xxxxx is the name of your database.   Using this as my new variable, I can loop over the results and use the alter table to add my little ‘deleted’ switch.

<cfoutput query=”test”>
 <CFQUERY NAME=”testUpd” datasource=”#dsn#” username=”#dbuser#” password=”#dbpass#”>    
  ALTER TABLE #test.tables_in_xxxxx#
  ADD Deleted TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
 </CFQUERY>
</cfoutput>

So there you have it.  A nice tidy way to make a mass update to all tables in the database.  This can be modified in all sorts of ways.  Say I wanted to change the datatype of one of my fields, and it has foreign key references all over the place.  Well, I can do the same thing with the CHANGE column syntax.  Of course, as always, be wary of housing this online anywhere where it could be accessible to those who would have some ill intent, having database permission to alter tables is a dangerous set of permissions to be floating around.

Tags: , , , ,

Posted in Amy, Programming

A little Salsa

Tuesday, May 6th, 2008

Everyone likes to eat food with a variety of tastes, sweetness, textures, and ingredients. For example, on Thanksgiving dinner, I like to have my turkey with gravy, mashed potatoes, corn, and greenbeans together, others do not. Dynamic Digital Advertising is strutured in a similar fashion, less the whole food thing. DDA is an advertising agency with numerous services and capablilities such as copywrighting, database programming, medical animation, video production, product photography, web design, and of-course search engine optimization services.

That’s what makes DDA such a great place to work with; DDA is a one-stop-shop full service advertising company, which will aid, assist, and commit to everything clients or prospects desires or needs. DDA is like a meal, it always works out better when you eat everything together.

Tags: , , , , , , , ,

Posted in Paul, Search Engine Marketing

Testing, testing, and re-testing

Tuesday, May 6th, 2008

Nothing is more satisfying than finishing a massive project. I think the feelings of accomplishment and relief are universal to all when a task comes to a close that you have invested much time and effort. But though this feeling of elation may be addicting, rushing to complete a project just for the sake of finishing is a grave mistake. This holds true for all projects here at DDA. Creative online copy must be proofed and re-proofed, custom admin and database programming functionality must be verified, and graphic designs should be thoroughly reviewed. If not, you may experience a few moments of the “I finished a project” feel goods, quickly followed by regret for the oversights.

At DDA we have set in place a system of review to try and eliminate these faux pas. Every page of copy is thoroughly reviewed by fellow writers. After the page is posted to a website or laid out in a stylish design, round two of proofing commences. To some, this may seem like overkill, but our clients expect and deserve the highest caliber of work and this system of retracing our steps to ensure accuracy is a means of guaranteeing quality.

So, with every project completed, comes an equally important task of quality assurance.  Without it, the minor oversights will overshadow the hours of hard work. So test, test, and re-test!

Tags: , , , , , ,

Posted in Copywriting, Elise

Orderwave

Wednesday, April 23rd, 2008

Orderwave is a software application that can automate many processes of an online ordering application or shopping cart. It can do order retrieval, data validation, inventory allocation, data delivery, and payment processing and capturing. It can act as a gateway between a warehouse, shipping, and your commerce shopping application. Orderwave passes data between the client cart and Orderwave system through XML. Some of the XML methods that they have are addorder, getinventory, getshipupdate, getorderstatus, getcatalog, and getcarrierrejects. For the application I was coding, I only needed to used the addorder method.

First, I had to build the list of order items in a variable through a loop.

<cfset linedata = “”>

<cfset numitems = 0>

<cfloop query=”Cart”>

<cfset numitems = numitems + 1>

<cfset linedata = linedata & ” <line_item>

<item_number>#Cart.SKU_MERCHSKUID#</item_number>

<inventory_number>#Cart.SKU_MERCHSKUID#</inventory_number>

<item_description>#Cart.product_Name#</item_description>

<item_price>#Replace(NumberFormat(Cart.SKU_Price,’999999999.99′),” “,”",”ALL”)#</item_price>

<item_quantity>#Cart.cart_sku_qty#</item_quantity> <extended_item_price>#Replace(NumberFormat(Cart.SKU_Price*Cart.cart_sku_qty,’999999999.99′),” “,”",”ALL”)#</extended_item_price>

</line_item>

“>

</cfloop>

Then, I had to build the addorder XML method in a variable then post it through https to Orderwave’s server.

<cfoutput>

<cfsavecontent variable=”strXML”><?xml version=”1.0″ encoding=”utf-8″ ?>

<orderwave>

<call>addorder</call>

<version>1.0.8</version>

<username>#Replace(Replace(orderwavelogin, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</username>

<password>#Replace(Replace(orderwavepass, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</password>

<call_values>

<order_number>#Replace(Replace(Client.CartID, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</order_number>

<order_status>active</order_status>

<order_date>#Year(now())#-#month(now())#-#Day(now())#</order_date>

<email>#Replace(Replace(CustBilling.cst_Email, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</email>

<ship_method>#Replace(Replace(getMethodName.shipmeth_OName, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</ship_method>

<ship_instructions>none</ship_instructions>

<partial_shipment>0</partial_shipment>

<gift_order>0</gift_order>

<order_source>website</order_source>

<bill_to>

<bill_firstname>#Replace(Replace(CustBilling.cst_FirstName, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</bill_firstname>

<bill_lastname>#Replace(Replace(CustBilling.cst_LastName, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</bill_lastname>

<bill_address1>#Replace(Replace(CustBilling.cst_Address1, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</bill_address1>

<bill_address2>#Replace(Replace(CustBilling.cst_Address2, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</bill_address2>

<bill_city>#Replace(Replace(CustBilling.cst_City, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</bill_city>

<bill_state>#Replace(Replace(CustBilling.stprv_Name, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</bill_state>

<bill_zip>#Replace(Replace(CustBilling.cst_Zip, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</bill_zip>

<bill_country>#Replace(Replace(CustBilling.country_Code, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</bill_country>

<bill_phone>#Replace(Replace(CustBilling.cst_Phone, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</bill_phone>

</bill_to>

<ship_to>

<ship_firstname>#Replace(Replace(GetToken(CustShipping.cst_ShpName, 1, ” “), “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</ship_firstname>

<ship_lastname>#Replace(Replace(Replace(CustShipping.cst_ShpName,”#GetToken(CustShipping.cst_ShpName, 1, ” “)# “,”"), “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</ship_lastname>

<ship_address1>#Replace(Replace(CustShipping.cst_ShpAddress1, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</ship_address1>

<ship_address2>#Replace(Replace(CustShipping.cst_ShpAddress2, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</ship_address2>

<ship_city>#Replace(Replace(CustShipping.cst_ShpCity, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</ship_city>

<ship_state>#Replace(Replace(CustShipping.stprv_Code, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</ship_state>

<ship_zip>#Replace(Replace(CustShipping.cst_ShpZip, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</ship_zip>

<ship_country>#Replace(Replace(CustShipping.country_Code, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</ship_country>

<ship_phone>#Replace(Replace(CustBilling.cst_Phone, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</ship_phone>

</ship_to>

<continuity>

<enrolled>0</enrolled>

</continuity>

<charges>

<sub_total>#Replace(Replace(Replace(NumberFormat(Client.OrderTotal-(Client.ShipTotal+Client.TaxAmt),’999999999.99′),” “,”",”ALL”), “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</sub_total>

<tax>#Replace(Replace(Replace(NumberFormat(Client.TaxAmt,’999999999.99′),” “,”",”ALL”), “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</tax>

<shipping>#Replace(Replace(Replace(NumberFormat(Client.ShipTotal,’999999999.99′),” “,”",”ALL”), “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</shipping>

<discount>0.00</discount>

<total>#Replace(Replace(Replace(NumberFormat(Client.OrderTotal,’999999999.99′),” “,”",”ALL”), “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</total>

</charges>

<payment>

<payment_status>uncharged</payment_status>

<cc_number>#Replace(Replace(request.CCNumber, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</cc_number>

<cc_expiration_month>#Replace(Replace(request.ExprMonth, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</cc_expiration_month>

<cc_expiration_year>#Replace(Replace(request.ExprYr, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</cc_expiration_year>

<cc_cvv>#Replace(Replace(request.CCV, “>”,”>”,”ALL”), “<”,”<”,”ALL”)#</cc_cvv>

<check_account_number></check_account_number>

<check_routing_number></check_routing_number>

<check_bank_name></check_bank_name>

<check_branch_city></check_branch_city>

<multi_pay_profile></multi_pay_profile>

</payment>

<line_item_count>#numitems#</line_item_count>

<line_items>

#linedata#</line_items>

</call_values>

</orderwave></cfsavecontent></cfoutput>

<cfset strXML = Replace(strXML, “&”,”&”,”ALL”)>

<cfhttp url=”https://app.orderwave.com/api/main.lasso” timeout=”4000″ port=”443″ method=”post”>

<CFHTTPPARAM type=”body” name=”transaction” value=”#strXML.trim()#” encoded=”no”>

<CFHTTPPARAM type=”HEADER” name=”Content-Type” value=”text/xml” encoded=”no”>

</cfhttp>

Tags: , , , ,

Posted in Tyler

Are We There Yet?

Monday, April 21st, 2008

The majority of my weekend I spent driving. Over 13 hours to be exact. The drive was tedious to say the least and I spent a large portion of it wishing it was over. I’ve found this, “Are we there yet?” mentality transcends to more applications in life than just driving. Often times we have the finish line in site, but we often wish to skip the whole ‘getting there’ process.  But without the hard work and time, would the final destination be as sweet?—probably not.

Like a long trek to a highly-anticipated location, the steps towards the completion of a project can be lengthy and involved.  But these advances towards the final product are what make the end result so rewarding. Proper website development, brochures, custom corporate and medical videos, 2d and 3d animations, and admin and database programming require a vast amount of time and effort. Though seeing the final product is supreme, the steps getting there are what make the project a success.

At DDA, our production process is carefully mapped-out to ensure the final destination is all that you imagined it would be. Programmers, graphic designers, webmasters, search engine optimization specialists, and project coordinators, work seamlessly together to ensure the process is done right. And though it may at times be lengthy, the end result is well worth the wait.

Tags: , , , , , , , , , , ,

Posted in Elise

Love the Variety

Thursday, April 17th, 2008

Two days ago I was coding in ColdFusion and working in Flash. Yesterday I worked in Director. Today I will be doing some 3D modeling in Lightwave. Tomorrow who knows.

That is how I like it to be. DDA offers so many different services that I get to work in a number of different areas. I never have the thought of becoming bored with my job because everyday is different. It is more like having 10 different jobs and I don’t know which one I will be at during any day. Will I be a programmer today? Maybe I will be an animator and a 3D modeler. Maybe I will even be a web developer today.

Either way, the task at hand will never be stale because I always get a break from one area while I am working in another. It also helps to expand my skills in so many areas. Before I came here, I didn’t know ColdFusion and now I have a solid base in it. Director is my newest area and as I keep learning more I will only have more of a variety of jobs to do.

As they say, variety is the spice of life.

Tags: , , , , , , , , , ,

Posted in Vinnie

Balancing the Load

Wednesday, April 16th, 2008

How much can one man or woman carry?  Some of us may be well versed in taking on heavy loads without buckling under the immense weight, but others may crumble. At DDA we are expected to continuously support a plethora of tasks, and if not managed correctly, you may find yourself struggling to support the load.  

As a full-service advertising agency that specializes in all things digital, our tasks are varied. Graphic design, website development, custom admin and database programming, corporate and medical video creation, and training programs are carried out seamlessly under one roof.  One person may be working on several projects at once, each with their own importance and designated deadlines. Consequently the pressure at times can be great and if you are not well versed in managing your time, the pressure can become overwhelming.

This ability to multitask is especially vital for me as a Project Coordinator. I am constantly striving to improve my efficiency and continually look to my coworkers for ways in which I can improve. When you are the liaison between a slew of clients and DDA staff, and you must also allocate time for your own projects, whether they are optimized content for a new website or creative copywriting for a brochure, the work load can be heavy. Each Project Coordinator has their own methods of managing tasks. Some desks are covered in an array of Post-It notes and some allocate designated times for a variety of tasks per day. Whatever the means, managing your time is crucial, or else you will quickly find yourself buckling under the weight.    

Tags: , , , , , , , , , , ,

Posted in Elise

The DDA Chameleons

Tuesday, April 8th, 2008

 

My position at DDA is anything but redundant or formulaic. We consider ourselves a full-service advertising agency that caters to the specific needs of every client. Consequently the scopes of projects we handle are vastly varied. We do it all; from corporate and medical videos, training programs, e-commerce websites, to search engine enhanced copywriting, our capabilities are truly enormous.

With that said, work at DDA is a continual learning process. While I may be well versed in advertisement and creative copywriting, I must perpetually expand my knowledge to acclimate myself to my clients’ products and services.  For every project, the target audience and philosophy of the product and company must be considered. A style of writing and voice is tailored specifically to represent a company’s services and products in the most appropriate and effective way possible. The role of a copywriter is therefore dynamic and never static. We are like chameleons, adapting to every situation in order to achieve the ideal result.

As a Project Coordinator I work closely with each department. Everyday I learn something new about the video production process, database and admin programming, as well as graphic design. No, my job here is certainly not boring and I am thankful for this.

Tags: , , , , , , , , , ,

Posted in Elise

Pushing the Boundries

Wednesday, April 2nd, 2008

Building complex websites that are at once user friendly and innovative can be a challenging task. Companies want a website that present thier products and services in a unique way that demands the attentions’ of users and catapults their business above the competitions’. I have found through my experience as a Project Coordinator, the DDA team is well versed in achieving just this—a  new and exciting way to build not only websites, but corporate and medical videos, brochures, Corporate and Medical Training programs, and more.

DDA seems to excel at pushing the boundaries of the norm to achieve new and groundbreaking methodologies of video production, database programming, and graphic design. Just look at our website as an example. Several technologies are combined to make an experience like no other. Custom videos interact with site navigation, live actors are integrated into well-crafted 2d animations, and custom programming enable exciting functionality. Though the experience is one that is new to many, the DDA team never loses site of ease of use and functionality.

A project I am currently overseeing is an excellent example of our team’s expertise in pushing the boundaries while achieving an intuitive and easy to use website. Video elements, custom database and admin programming, and innovative designs meld together to create a site that can only be defined as groundbreaking, however the core philosophy centers on the users’ ability to navigate and utilize the site with ease.

Tags: , , , , , , , , , ,

Posted in Elise

Data Storage

Wednesday, April 2nd, 2008

Most of the sites we develop involve database programming. DDA programmers (myself included) commonly use MySQL Databases. MySQL has a many configurable options (i.e. what type of storage engine). We use many tools to manipulate table structures, fields, and data such as DBTools Manager Professional, PHPMyAdmin, Microsoft SQL Server Management Studio, and MYSQL Administrator. We mostly use the default one MyIsam or InnoDB, which is currently very popular. Since it is important that databases function properly at all times, we perform several backups throughout the day and perform weekly off-site backups to ensure that if information is deleted accidentally or the data gets corrupted, the records can be restored.

Tags: , ,

Posted in Tyler

Search


type and hit 'enter'