This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0 maximum-scale=1.0" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//source: http://www.toao.net/48-replacing-smart-quotes-and-em-dashes-in-mysql | |
//By Mango, March 5th, 2009 | |
//clean charset | |
function c($text){ | |
// First, replace UTF-8 characters. | |
$text = str_replace( | |
array("\xe2\x80\x98", "\xe2\x80\x99", "\xe2\x80\x9c", "\xe2\x80\x9d", "\xe2\x80\x93", "\xe2\x80\x94", "\xe2\x80\xa6"), | |
array("'", "'", '"', '"', '-', '--', '...'), | |
$text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Bruteforce. Index all the columns in all tables of a db. | |
-- Find the data types | |
-- select distinct data_type from information_schema.columns where table_schema="DATABASE"; | |
select | |
concat( "ALTER TABLE `DATABASE`.`", table_name , "` ADD INDEX ( `",column_name ,"` );" ) | |
from information_schema.columns where table_schema='DATABASE' and | |
data_type not in ('text', 'longtext', 'mediumtext','tinytext' ); |
NewerOlder