Skip to content

Instantly share code, notes, and snippets.

View erinbush's full-sized avatar

Erin N. Bush erinbush

View GitHub Profile
@erinbush
erinbush / map4
Created October 14, 2012 16:46
Parsing JSON to add details to multiple window boxes in a map
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map_canvas { height: 100% }
@erinbush
erinbush / joindisplay
Created October 13, 2012 00:02
Joining tables and combining results in a table.
<p>
<p><h2>Details</h2></p>
<p>Details of all the executions by state with lat/long data.</p>
<p><table border='1' cellpadding='10'>
<tr><th>First Name</th><th>Last Name</th><th>Crime</th><th>State</th><th>Lat</th><th>Long</th></tr>
<?php
$result = mysql_query("SELECT * FROM executions INNER JOIN statelatlong ON executions.statelatlongid = statelatlong.id", $connection);
if (!$result) {
@erinbush
erinbush / insert.php
Created September 20, 2012 00:56
PHP Form code
<?php
/* Create database connection */
$connection = mysql_connect("localhost", "db", "pw");
if (!$connection) {
die("Database connection failed: ");
}
/* Select a database */
$db_select = mysql_select_db("szecetl_crimetest",$connection);
if (!$db_select) {