Yanor.net/
Wiki
Blog
GitHub
Sandbox
開始行:
* INSERT/UPDATE/DELETE [#xa124878]
$sql = 'insert into t1 (num, str) values (?,?)';
$sth = $dbh->prepare($sql);
$sth->execute(time,"i'm happy");
** prepare()とexecute()をまとめて行う [#d338218c]
$num_of_rows = $dbh->do('update t1 set num = ? where num...
影響した行数が0の場合は、$num_of_rowsには"0E0"が入ってる...
** 影響した行数 [#b599df14]
$num_of_rows = $sth->rows;
$num_of_rows = $sth->execute;
** シリアル(AUTO_INCREMNT)型の値の取得 [#n8102093]
print $dbh->last_insert_id(undef,undef,'t1','id'); # ...
print $dbh->last_insert_id(undef,undef,undef,undef); # M...
終了行:
* INSERT/UPDATE/DELETE [#xa124878]
$sql = 'insert into t1 (num, str) values (?,?)';
$sth = $dbh->prepare($sql);
$sth->execute(time,"i'm happy");
** prepare()とexecute()をまとめて行う [#d338218c]
$num_of_rows = $dbh->do('update t1 set num = ? where num...
影響した行数が0の場合は、$num_of_rowsには"0E0"が入ってる...
** 影響した行数 [#b599df14]
$num_of_rows = $sth->rows;
$num_of_rows = $sth->execute;
** シリアル(AUTO_INCREMNT)型の値の取得 [#n8102093]
print $dbh->last_insert_id(undef,undef,'t1','id'); # ...
print $dbh->last_insert_id(undef,undef,undef,undef); # M...
ページ名: