Any technique that saves round trips to the database pays for itself exponentially over time. MySQLs bulk Insert or Update syntax is one of those techniques.
MySQL Sales Reporting by Holiday
Not all real-world reporting requirements align well with how your data is organized. In my case, I had to produce sales reports tied to a US Holiday (which varies year-to-year).
Combining multiple SQL queries for listing pages into one
With a little extra effort, you can construct a single query that returns multiple rows using the SQL IN operator.
From there, you can convert the query results into a language construct that is easy to work with.
Amazon RDS with MySQL – My Experience
Migrating a database over to Amazon RDS isn’t an all day event, but you will run into a couple snags. This post points out two issues that I ran into and quick solutions.
MySQL Group Concatenation – The hidden function
The MySQL GROUP_CONCAT function isn’t a well-known feature, but it is one of the most useful functions that exists in MySQL. I call it the “loop-killer”. Here are a few ways to put it to use on your site.
Fun with SQL Injection
There are dozens of different ways to be a victim of an SQL injection attack. This article offers a more example-driven approach to learning about SQL Injection and how to avoid it.
Hand some validation over to your database
Performing validation at the database level not only protects the integrity of our data, but also presents a performance enhancement while simplifying our application code.
Replicate or copy a database table with PHP
If your table is updated often, queries will rarely pull from cache. Depending on your situation, performance may be more important than up-to-the-second data accuracy.
Taming Web SQL
If you’re coming from server-side development, Web SQL might appear to be both limiting and difficult to grasp. You’re used to sending a request to…
Constructing complex SQL queries
As a web programmer, not a day goes by without needing to touch SQL in some form. Some days you're lucky enough to be modeling…