demosthenes.info

I’m Dudley Storey, the author of Pro CSS3 Animation. This is my blog, where I talk about web design and development with , and . To receive more information, including news, updates, and tips, you should follow me on Twitter or add me on Google+.

web developer guide

my books

Book cover of Pro CSS3 AnimationPro CSS3 Animation, Apress, 2013

my projects

CSSslidy: an auto-generated #RWD image slider. 1.5K of JS, no JQuery. Drop in images, add a line of CSS. Done.

tipster.ioAutomatically provides local tipping customs and percentages for services anywhere.

Handy MySQL Queries: Random Rows, Sequence Gaps, Replace Content & Word Count

mysql

Estimated reading time: 1 minute, 24 seconds

Occasionally you’ll have a need for a query that doesn’t quite fall under the standard range of MySQL statements. A few examples:

Simple INSERT Into A MySQL Database

mysql / introduction

Estimated reading time: 2 minutes, 21 seconds

In previous articles I’ve covered the creation of a MySQL database, and how to select information from it. In this article, I’ll cover insertion of user data into a table.

Insertion of data is usually done via a web form. There are many reasons we might want to do this: the obvious cause is to record input from a user, such as a comment in a blog, or an order for a product. Here, we’ll create a simple version of the former.

First, we’ll create a simple HTML5 on a page:

Write a Customisable MySQL Query

mysql

Estimated reading time: 1 minute, 54 seconds

The easiest way to alter a query based on user choices is to place that choice in the form a URL variable, otherwise known as a $_GET variable. For example, let’s say we wanted to give our site visitor the choice of seeing the details for products we have listed in a database table called bikes:

This site helps millions of visitors while remaining ad-free. For less than the price of a cup of coffee, you can help pay for bandwidth and server costs while encouraging further articles.