1$value = "your value here";
2
3try {
4 $pdo = new PDO($dsn, $username, $password, $>drivers);
5 } catch (\PDOException $e) {
6 echo 'Connection Failed: ' . $e->getMessage();
7 }
8
9$sql = "INSERT INTO `my_db` SET `field` = ? ";
10$stmt = $this->pdo->prepare($sql);
11 $stmt->bindValue(1, $value, PDO::PARAM_STR);
12 $stmt->execute();
13 $stmt = null;
1String tableName;
2switch(PARAM):
3 case "Value1": tableName = "fooTable";
4 break;
5 case "Value2": tableName = "barTable";
6 break;
7 ...
8 default : throw new InputValidationException("unexpected value provided"
9
10