Task 2: Results of a MySQL query

The Articles from the Database:

titledate

Verisign is damage: route around it

Wednesday, September 17, 2003 at 04:41
Yesterday, Verisign (the company I'd like to see put to death) broke the Internet by redirecting all unregistered .COM and .NET addresses to a page on their site where they run a search-engine. For a lot of good technical reasons, this is a bad idea, and it makes a savage mockery of Verisign's (unbelievably lucrative) monopoly on critical pieces of the Internet's infrastructure.

Today, the makers of the BIND DNS software responded by announcing a patch that will interpret Verisign as damage and route around them.

However, the ISC is about to undercut the Site Finder service with a patch to its BIND software.

BIND runs on about 80 percent of the Internet's domain name servers -- the machines that translate human-readable Web addresses like www.wired.com into machine-readable Internet addresses used by the Internet's vast network of computers.

The patch will be released by the end of Tuesday, said Paul Vixie, ISC's president.

Link

NYT cartoon: The Copyright Cops

Wednesday, September 17, 2003 at 05:16
Hilarious and instructive cartoon in today's New York Times about copyright crackdowns and the RIAA lawsuits, with guest cameos by the EFF's Fred Von Lohmann and the RIAA's Amy Weiss. Link (registration required)

Virtual Museum of Bacteria

Tuesday, September 16, 2003 at 15:09
The subject line says it all, folks. An online tribute to the glory that is, um, bacteria. Link (via Viridian list)

Translate gangsta to pirate

Wednesday, September 17, 2003 at 03:18
Nice Gangsta-Pirate translation table:
Gangstah Pirate
fo'ties bottles o' rum
bling bling booty
Yo! Avast!
Homey Matey
Bee-atch Scurvey dog
Link (via Making Light)
 

Attribution

Content by Cory Doctorow and Xeni Jardin of BoingBoing.net, subject to Creative Commons attribution/non-commercial license.

Index | Next»

Questions? csnyder@chxo.com

Source of this script

<?php
// initialize template
include_once('libs/Smarty.class.php');
$template= new Smarty;
$template->assign('title''Task 2: Results of a MySQL query');
$template->assign('next''task3-smarty.php');

// TASK: display results of a MySQL query
// get database connection info
include('../task2-config.inc');

$db= @mysql_connect($ORGHOST,$ORGUSER,$ORGPASS);
if (!
$db) {
    exit(
"Database error, could not connect to server.");
}
if (!
$database= @mysql_select_db($PRESENTATION_DB)) {
    exit(
"Database error, could not connect to database.");
}

// query database and dump results into $articles array
$query"SELECT * FROM presentations.3templates ";
$resultmysql_query($query);
$articles= array();
if (
$result) {
    while (
$arraymysql_fetch_assoc($result)) {
        
$articles[]= $array;
    }
}

// assign the articles array to the template
$template->assign('articles'$articles);

// display the template
$template->display('task2.tpl');
?>

<h3>Source of this script</h3>
<?php
$output
highlight_file($_SERVER['SCRIPT_FILENAME'],1);
print 
$output;
?>

<h3>Source of the template</h3>
<?php
$output
highlight_file(dirname($_SERVER['SCRIPT_FILENAME']).'/templates/task2.tpl',1);
print 
$output;
?>

Source of the template

{* Smarty: task 2 template *}
{include file="header.tpl"}

<h3>The Articles from the Database:</h3>
<table style="width: 600px;">
    <tr class="header">
        <td>title</td><td>date</td>
    </tr>
{section name="a" loop=$articles}
    <tr class="{cycle values="odd,even" advance=0}">
        <td><h4>{$articles[a].title|escape}</h4></td>
        <td>{$articles[a].created|date_format:"%A, %B %e, %Y at %H:%M"}</td>
    </tr>
    <tr class="{cycle values="odd,even" advance=1}">
        <td colspan="2">{$articles[a].content}</td>
    </tr>
{sectionelse}
    <tr class="odd">
        <td colspan="2">There are no articles yet.</td>
    </tr>
{/section}
    <tr class="header">
        <td colspan="2">&nbsp;</td>
    </tr>
</table>

<h3>Attribution</h3>
<p>Content by Cory Doctorow and Xeni Jardin of <a href="http://boingboing.net">BoingBoing.net</a>, subject to Creative Commons <a href="http://creativecommons.org/licenses/by-nc/1.0">attribution/non-commercial license</a>.</p>

{include file="footer.tpl"}