Skip to content

Instantly share code, notes, and snippets.

View jkuroiwa's full-sized avatar

Jared I. Kuroiwa jkuroiwa

View GitHub Profile
@jkuroiwa
jkuroiwa / demobuild.php
Created July 27, 2012 08:55 — forked from sirpengi/demobuild.php
Demo for Socrata API JSON import into MySQL
<?php
function hobo_escape($val){
// because there is no good way to escape a dynamic table/field name
$ret = preg_replace('/[^a-zA-Z _]+/', '', $val);
$ret = preg_replace('/\s+/', '_', $ret);
return $ret;
}
// Credentialing for MySQL server if you want the code to create table and load data automatically