PDO

pecl::PDO

AdvancedSearch | AreaMap ]

Search:

  Welcome   Installation   FAQ   User Notes   Links  
  User Notes   bindParam   DSN   exec   API differences   fetchCol   setAttribute   API  

Username:

Password:


Areas In
This Wiki

BEPHPUG

Conferences

emPHPower

LiveUser

Main

MDB2

PDO

PEARThinkTank

PHPSVN

PHPTODO

RDBMS

WebBuilder2

exec

execute() in ADOdb and query() in PEAR::DB can be used instead of prepare() and execute(), if you set a second parameter (data array) and your query uses placeholders.

In PDO exec() can only do the following:


<?php
$count = $dbh->exec("DELETE FROM fruit WHERE colour = 'red'");
?>

what about something like:


<?php
$data = array(
 'extension' => $extension,
 'name' => $name
);
$count = $dbh->exec("INSERT INTO CREDITS (extension, name) VALUES (:extension, :name)", $data);
?>

of course the second parameter is optional. The syntax should fit to bindParam.

PDO:exec (212.202.40.148)
Thu, 17 Mar 2005, 16:17
[ Links | Source | History | RSS ]

This site powered by YaWiki 0.22 beta.


No user comments exist for this page.

Add A Comment
Email:
*Comment:
Catpcha:
* denotes required field

Your comment will be added immediately; please check your comments, and be nice. :-)

Please use plain text only; HTML and PHP code will be converted to entities.

Your email address will be obfuscated with [AT] and [DOT] after you post your comment.