Code

There are 12 posts in the MySQL category:

Title Sort MySQL Results

MySQL | PHP
Shows you how to sort MySQL results by title, ignoring indefinite and definite articles (a, an, the). » View Post

Convert an Entire MySQL Table to UTF-8

HTML | MySQL | PHP
A PHP function (with lots of comments) that converts a MySQL table and its data to UTF-8. It updates the collation of the table itself and of each text-based column. Additionally, it goes through each row and updates existing data automatically. » View Post

List of Latitudes and Longitudes for Every State

Data Dumps | Maps | MySQL
A list of the center latitude and longitude for all fifty of the United States (generated by taking the average latitude and longitude from each zip code within the state). In both HTML table and MySQL format. » View Post

Combining MySQL SUM and GROUP BY Clauses

MySQL
An experiment that shows how MySQL calculates a combination of SUM and GROUP BY clauses in the same query. » View Post

MySQL Vertical Display in HTML Table

HTML | MySQL | PHP
PHP code to display results from a MySQL query sorted vertically (rather than horizontally) in a table. Very simple and allows for custom number of columns. » View Post

PHP MySQL Database Functions

Helpers | MySQL | PHP
The more I worked with MySQL and PHP, the more I realized that I was typing the same code over and over again. And, some of the functions I used most were really long and annoying to type. So, I created these functions as a shortcut. I include them in each file I write and they save a lot of time. » View Post

How to Pull a Twitter Feed Into Your Site Using PHP, MySQL, and the Twitter API

MySQL | PHP | Twitter
A quick tutorial on how to use the Twitter API to store your Tweets locally in a MySQL database and then display them on your website. » View Post

Custom Sorting MySQL Data

MySQL
A quick tutorial explaining how to do custom sorts on your data from within the MySQL query, using the CASE statement. » View Post

Generate PHP Code to Display MySQL Table

MySQL | PHP
This chunk of PHP code automatically generates the PHP code to display a MySQL table. All you have to do is change the table name and enter your database settings. This comes in handy so that you can format each column appropriately depending on the data type (dates, emails, etc.) rather than just having to display the data exactly as it's stored in the database. » View Post

Canadian Provinces in MySQL Table

Data Dumps | MySQL
A data dump of all the Canadian provinces and abbreviations in MySQL format. » View Post

U.S. State Abbreviations in MySQL Table

Data Dumps | MySQL
A data dump of all the U.S. states (and Washington, D.C.) and their abbreviations in MySQL format. » View Post

Copy MySQL Table Rows in PHP

MySQL | PHP
This little chunk of PHP grabs all the rows from the source table and inserts them into an (identical) destination table. It's useful for backups or an automated process that you don't want to always be logging into phpMyAdmin to do. » View Post
Copyright © 2014, Ink Plant. All rights reserved.