Re: DBD::Pg problem

Поиск
Список
Период
Сортировка
От Doug McNaught
Тема Re: DBD::Pg problem
Дата
Msg-id 87ad6a9eoi.fsf@asmodeus.mcnaught.org
обсуждение исходный текст
Ответ на Re: DBD::Pg problem  (Barbara Lindsey <blindsey@cog.ufl.edu>)
Список pgsql-general
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.

If you do this in production (rather than just for debugging) you may
be vulnerable to an SQL injection attack...

> Besides that, you can print the $sql string with the expanded
> variables and copy and paste it into psql to see if that gets you a
> different error to help debug if it is not already obvious when you
> see the whole SQL.

...but it is useful for debugging.

-Doug

В списке pgsql-general по дате отправления:

Предыдущее
От: "Chris Travers"
Дата:
Сообщение: Re: Feature Request for 7.5
Следующее
От: Harald Fuchs
Дата:
Сообщение: Re: DBD::Pg problem