What?
Practice makes perfect. Or in my case, any practice is a start. This article serves as a quick note on how to use regular expressions within SQL statements:

How?
For the following examples, I am pretending to select rows from a table called `STUDENTS`.

What?
A quick reminder on basic regular expressions.


Match Any Character — Dot
The dot operator '.' matches any single character in the current character set. For example, to find the sequence--'a', followed by any character, followed by 'c'--use the expression:

a.c
This expression matches all of the following sequences:
abc
adc
a1c
a&c
The expression does not match:
abb

What?
I was going to append this to one of my articles on anti-sql injection but as this may undergo some revisions, I'll give it it's own page.

Why?
The following PHP code accepts a username and password login and demonstrates how to check against the database without including text that the website visitor submits.

How?

What?
This is an article to remind me how to modify a column in a database table the old fashioned way (as in stop making me use GUI interfaces so poorly programmed when even I've made better DBMS tools).

All SQL

-- Add a column to an existing table (giving it datatype char(2) and allowing NULL)
ALTER TABLE myTable ADD myColumn CHAR(2) NULL

-- Delete a column
ALTER TABLE myTable DROP COLUMN myColumn 

-- Reorder a column
ALTER TABLE myTable MODIFY COLUMN misplacedColumn AFTER otherColumn;

Subcategories