setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Creates a liveObject if the URL parameter is set if (isset($_GET["name"])) { $name = $pdo->quote($_GET["name"]); $user = new liveObject($pdo, 'users', "username = $name"); } else { // Otherwise use (dirty) way to create a placeholder object instead $user = (object) array("name" => "unknown", "age" => "-", "visits" => 0); } ?>
Visits: = $user->visits++ ?>