I tried that code but got an error when the code got to $db = new SiteDb; and I don't follow this part either

PHP Code:
if (! $result $db->query($query)) { 
        echo(
$db->error()); 
        die(
'Query error.'); 
    } 
which is why I went searching for another example.