Shows and Events

A listing of some local events.
“Local” to us means around Southern NH or in the general New England area

[insert_php] try { $host = “localhost”; $dbname = “toysinth_events”; $dsn = “mysql:host=$host;dbname=$dbname”; $user = “toysinth_admin”; $pw = “t0Yz6EVenz9”; $db = new PDO($dsn,$user, $pw); function displayAllEvents($db) { $events_query = ‘SELECT * FROM T_SHOWS_EVENTS WHERE T_SE_DATE >= CURDATE() ORDER BY T_SE_DATE;’; $events = $db->query($events_query); echo “
“; foreach($events as $event) { $event_id = $event[‘T_SE_ID’]; $event_name = $event[‘T_SE_NAME’]; if ($event[‘T_SE_DATE’] === null) { $event_date = ” “; } else { $event_date = date(“F j, Y”, strtotime($event[‘T_SE_DATE’])); } if ($event[‘T_SE_TIME_START’] === null) { $event_start_time = ” “; } else { $event_start_time = date(“h:i A”, strtotime($event[‘T_SE_TIME_START’])); } if ($event[‘T_SE_TIME_END’] === null) { $event_end_time = ” “; } else { $event_end_time = date(“h:i A”, strtotime($event[‘T_SE_TIME_END’])); } $event_location = rtrim($event[‘T_SE_ADDRESS’] . “, ” . $event[‘T_SE_CITY’] . “, ” . $event[‘T_SE_STATE’] . “, ” . $event[‘T_SE_ZIP’], ‘, ‘); $event_description = $event[‘T_SE_DESC’]; $event_moreinfo = $event[‘T_SE_MOREINFO’]; $event_image = “/wp-content/uploads/” . $event[‘T_SE_IMAGE’]; $img_alttag = $event[‘T_SE_IMG_ALTTAG’]; if (($event[‘T_SE_IMAGE’] === ”) || ($event[‘T_SE_IMAGE’] === NULL)) { $img_tag = “Mustang Neon sign“; } else { $img_tag = “" . $img_alttag . "“; } echo ““; echo “
“; echo “
“; echo “
“; echo “

” . $event_date . “

“; echo “

” . $event_name . “

“; echo “
“; echo “
“; echo “

” . $event_start_time . ” – ” . $event_end_time . “

“; echo “

” . $event_location . “

“; echo “
“; echo “
“; echo “

” . $event_description . “

“; if (($event_moreinfo != null) || ($event_moreinfo != ”)){ echo ““; } echo “
“; echo “
“; echo “
” . $img_tag . “
“; /* if (($event_moreinfo != null) || ($event_moreinfo != ”)){ echo “
” . $img_tag . “
“; } else { echo “
” . $img_tag . “
“; } */ echo “
“; } // end foreach loop echo “
“; } // end ‘displayAllEvents’ function } catch (pdoexception $e) { $error_message = $e->getMessage(); echo “

An error has occured while connecting to the database: $error_message

“; } displayAllEvents($db); [/insert_php]

Add An Event
(sorry but this is for admins only)