Re: DBD::Pg problem
| От | Harald Fuchs |
|---|---|
| Тема | Re: DBD::Pg problem |
| Дата | |
| Msg-id | pu4qwix8wy.fsf@srv.protecting.net обсуждение |
| Ответ на | Re: DBD::Pg problem ("Ausrack Webmaster" <webmaster@ausrack.com.au>) |
| Список | pgsql-general |
In article <3FCDE437.9060309@cog.ufl.edu>,
Barbara Lindsey <blindsey@cog.ufl.edu> writes:
> When I have problems like this, I do something like this:
> $sql="insert into it_contact (email, to_email,
> subject,details,modify,parent) values(
> '".$from."','".$to,"','".$subject."','".$body."', now(),'".$parent."')";
> Then you dont have to bind params. You can just prepare and execute.
... and get interesting results if one of the variables contains
quotes or backslashes.
I often use something like that:
$dbh->do (q{
INSERT INTO it_contact (email, to_email, subject, details, modify, parent)
VALUES (?, ?, ?, ?, ?, ?)
}, undef, $from, $to, $subject, $body, now(), $parent);
This lets DBI do the proper quoting for you.
В списке pgsql-general по дате отправления: