Re: mysql prepared statements

From: Date: Sat, 27 Oct 2001 02:13:58 +0000
Subject: Re: mysql prepared statements
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-69103@lists.php.net to get a copy of this message

for example in PERL DBD::mysql you can prepare statements like so:

$sql = "update user_list set first_name = ? where id = ?"
$han = $dbh->prepare($sql);

$han->execute('andrew',1);
$han->execute('bill',2);
....

this is a very useful thing that's implemented in a lot of different languages (PERL, Java... )and i thought people might get a lot of use out of it in php...
it abstracts the details of escaping strings, enclosing them in single quotes, and type checking from the developer to make things easier.  it also speeds up execution in some circumstances.


At 06:59 PM 10/26/01 -0700, you wrote:
i'd like to get people's feedback on the possibility/ feasibility of implementing prepared statements in php for atleast MySQL and perhaps more. i'm new to the list, so maybe you've already discussed this. i'd like to start developing something like this soon unless someone else is already working on it. thanks! Prepared statements isn't something you implement in a scripting language. It is something that needs to be implemented in the SQL server itself. What exactly would you be "preparing" in PHP space? -Rasmus


Thread (5 messages)

« previous php.dev (#69103) next »