Mysql Data Snippets


29 December, 2012   

Example MySql code to append Data to Field in MySql

05 April, 2015   

A simple PHP script that outputs data into formatted columns.

23 October, 2012   

MySQL code example for sorting data in a GRID

Note that to add a new column to the query, just add in an input box to the HTML, the PHP generates an insert for each field.

19 May, 2012   

Example code to load CSV back into mySQL

30 August, 2011   

Calculates the total size of a MySQL database in KB/MB or GB...

05 December, 2012   

Instead of providing a traditional address to the image, the image file data is base64-encoded and stuffed within the src attribute. Doing so saves a network request for each image, and prevent exposure of directory paths. Please note that IE7 and below are not compatibles with data URIs.

This function builds an HTML select list from from data retrieved from a mySQL table.

In this example we will select everything in our table "example" and put it into a nicely formatted HTML table.

Two simple functions to read an write tab seperated files (like CSV files, etc).

07 April, 2014   

Adding a linked server to MSSQL account - particularly a MYSQL server

Source code for Binary tree creation, traversal and search

14 May, 2011   

This is a general code to use when updating an item from a MySQL database. This code isn't considered definitive and can be written in many varied ways. Note: This code requires you to connect to the MySQL database to work. Also, all field and table names need to be set up to match.

09 May, 2011   

This is a general code to use when inserting an item from a MySQL database. This code isn't considered definitive and can be written in many varied ways. An extention of this code would be to make sure the entry you are adding to the database doesn't already exist (to save dupicate entries). Note: This code requires you to connect to the MySQL...

14 February, 2012   

MySQL code to connect to db. Don't forget to change the parameters.

18 June, 2013   

Define few variables with your MySQL database connection settings and connect to MySQL database using mysql_connect() and mysql_select_db() functions.

If you have a database driven site and you want to optimize MySQL tables then this is perfect. It goes through all the tables in a MySQL database and does table optimization on each one using the MySQL Optimize Table syntax.

14 May, 2011   

This is a general code to use when deleting an item from a MySQL database. This code isn't considered definitive and can be written in many varied ways. A variation of the code would be not to delete the record (as you tend to always need to restore or retrieve it sooner or later) you can add a 'status' field. If status='d' then it is...

Below shown how to Back Up and Restore a MySQL Database

29 December, 2012   

How to Back Up and Restore a MySQL Database