List of Categories

CATEGORY: Programming

Create a New Database in MySQL Query Browser

MySQL Query Browser is an excellent (and FREE) GUI tool for managing your MySQL databases. In order to create a new database, follow the steps below. 1. Open MySQL Query Browser. You will be presented with the login screen. Fill in the appropriate information and click OK. 2. You may be presented with the following…

mySql error 1005 (errno: 150)

mySql error 1005 (errno: 150) solution This mysql error occurs when creating a table with the InnoDB engine and is basically telling you that there is a "foreign key problem" with your schema. The thing to check to fix this error is to make sure that your foreign key fields are of the same datatype…

PHP/MySQL: How to Store Queries in a Separate Include File

When implementing a php/mysql database (or any database for that matter), it's sometimes easy to have all of the queries located in one place, as opposed to having them hard-coded into the pages. If the queries are hard-coded in, and the queries are reused on multiple pages (which they often are), it can be a…

Regular Expression for Single Letter – PHP

I was working on a project where I needed to validate a querystring for a single letter -- uppercase or lowercase. Since there is no php equivalent to the is_numeric() function, (e.g. a hypothetical is_alpha() function) I decided to use regular expressions to get the task done. I could have used ctype_alpha(), but that function…

MySQL: How to Change the Database Name

Once you've created a MySQL database and named it you cannot rename the database using standard SQL commands such as ALTER in the same manner as you would rename a table. The way to rename a database is as simple as creating a new, empty database, and then recreating the old database in this new…