Skip to content

Instantly share code, notes, and snippets.

View AndrewChamp's full-sized avatar
:octocat:
Web Application Developer / System Admin

Andrew Champ AndrewChamp

:octocat:
Web Application Developer / System Admin
View GitHub Profile
@AndrewChamp
AndrewChamp / find.and.replace.sql
Created February 12, 2019 15:25
MySQL Find & Replace
UPDATE TABLE_NAME
SET COLUMN_NAME = REPLACE(COLUMN_NAME, 'string/to/find', 'string/to/replace')
# OPTIONAL: Replaces embedded strings
WHERE COLUMN_NAME LIKE ('%string_to_find%');
@AndrewChamp
AndrewChamp / search_database_tables_for_column_name.sql
Last active November 17, 2022 12:32
Search Database Tables for Column Name
# SEARCH DATABASE TABLES FOR COLUMN NAME
SELECT
table_name,
column_name,
data_type,
ordinal_position
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
@AndrewChamp
AndrewChamp / class.installer.php
Created November 10, 2020 08:29
Downloads remote framework and unpacks contents.
<?php
/**
* EXAMPLES OF USE
*************************************
*
* Download and unzip your custom framework. Then create the database connection file.
*
* $install = new installer();
* $install->download('http://your-domain.com/framework.zip');