コード例 #1
1
ファイル: newUser.php プロジェクト: eprincev-egor/task
<?php

$dbh = getDBH();
$sth = $dbh->prepare("INSERT INTO user (name) VALUES (:name)");
$sth->execute(array(":name" => ""));
$id = $dbh->lastInsertId();
echo json_encode(array("id" => $id));
コード例 #2
1
ファイル: index.php プロジェクト: eprincev-egor/task
function runSQL($sql, $exec = array())
{
    $dbh = getDBH();
    $sth = $dbh->prepare($sql);
    $sth->execute($exec);
    return $sth;
}