Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: f1dd180e8d
@lsmith77 lsmith77
30 lines (24 sloc) 0.517 kB
<?php
class HelloWorld
{
/**
* @var PDO
*/
private $pdo;
public function __construct(PDO $pdo)
{
$this->pdo = $pdo;
}
public function hello($what = 'World')
{
$sql = "INSERT INTO hello VALUES (" . $this->pdo->quote($what) . ")";
$this->pdo->query($sql);
return "Hello $what";
}
public function what()
{
$sql = "SELECT what FROM hello";
$stmt = $this->pdo->query($sql);
return $stmt->fetchColumn();
}
}
Jump to Line
Something went wrong with that request. Please try again.