Replacing Substrings using SQL, not PHP

Let’s say you have a problem: A recent DB migration has escaped a lot of quote marks within your fields and now your app is acting funny. Your task is to fix the problem, and do it FAST. Enter the replace() function in MySQL (assumed other RDBMs as well, such as Postgres and MSSQL) UPDATE …

Fixing Zen Cart’s Tax Miscalculation When Using a Coupon

I was recently alerted to an error in Zen Cart by a client where the tax was being miscalculated when using a coupon. Here’s the fix. Around line 240 in /store/includes/modules/order_total/ot_coupon.php Remove these lines: //$od_amount[$tax_desc] += (($products[$j][‘final_price’] * $products[$j][‘quantity’]) * $tax_rate)/100 * $ratio; //$od_amount[$tax_desc] += round(((($products[$j][‘final_price’] * $products[$j][‘quantity’]) * $tax_rate) + .5)/100 * $ratio, 2); …

Amberjack Media, RevealCMS

It’s official – I’m now Amberjack Media (amberjackmedia.com). The papers from the city just arrived, but the process with officially registering the DBA with the county is not yet complete. I have the domain, but it’s not yet set-up with any hosting space just yet. On another note, I’ve named the CMS i’m working on: …

Pre-QA isn’t good for interviews

I’m just going to throw this out there… if you have a piece of software, site, etc that isn’t quite at the QA stages, no matter how rockin’ in might be, you might want to consider holding off on showing it to others until you know the demo is going to work. I think I’m …

Mr. Fish Lite is coming

If you’re interested in the DFL project, you’ll be happy to know that German and I are tasked with a bit of a crack programming job in the next week or so. Actually, we told our boss the idea we had about making a “Lite” version of the data viewer program that runs through some …

Caching HTML Output with Smarty

I’ve begun using the Smarty template engine for my projects requiring dynamic content – you know, the good ol’ MVC (model-view-controller) approach to (web) applications. Because the sites I work on aren’t particularly high-traffic, I never really thought too hard about caching… until I actually began thinking about caching. The question is “why not?”. With …

Hey there! Come check out all-new content at my new mistercameron.com!