PHPで名前空間内でPDOを使うには、次のように記述します。
namespace YourNameSpace {
use PDO;
// ...
$pdo = new PDO(...);
// ...
}
このように、名前空間内でuse構文を使用してPDOクラスをインポートし、その後にPDOオブジェクトを生成することができます。
注意:PDO拡張モジュールがPHPにインストールされていることが前提となります。また、接続文字列(. . .の部分)は適切なものに置き換えてください。