Re: Using Database (PHP)
| From: | Ashkar Dev | Date: | Tue, 14 Jul 2020 15:09:38 +0000 |
| Subject: | Re: Using Database (PHP) | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-327230@lists.php.net to get a copy of this message | ||
Thanks,
do you know when it is required to use (prepare) function?
On Mon, Jul 13, 2020 at 10:26 PM Jigar Dhulla <jigar.tidus@gmail.com> wrote:
>
>
> On Tue, Jul 14, 2020, 12:41 AM Ashkar Dev <ashkardev@gmail.com> wrote:
>
>> Thanks,
>> Do you think PDO is better or pg_query_params?
>> because PDO is supported by PostgreSQL.
>>
>> On Mon, Jul 13, 2020 at 8:18 PM Jigar Dhulla <jigar.tidus@gmail.com>
>> wrote:
>>
>>>
>>>
>>> On Mon, Jul 13, 2020, 3:38 PM Ashkar Dev <ashkardev@gmail.com> wrote:
>>>
>>>> Does anyone have an answer?
>>>>
>>>> I have developed a web application, I used (pg_query) for working with
>>>>> the database:
>>>>>
>>>>> 1. should I convert all (pg_query) to (pg_query_params) or to (PDO)?
>>>>> 2. whats different between all these three types?
>>>>> 3. when it is necessary to use (pg_prepare)?
>>>>>
>>>>> Thanks.
>>>>>
>>>> Pdo is recommended if you plan to switch to other database. And
>>> parameterized queries are better as it prevents SQL injection (attack).
>>>
>>
> Yes, PDO is better from futuristic point of view. Can't comment which one
> is better in terms of efficiency. Guess is that pg_ will be faster as it is
> dedicated client for postgresql. Where as PDO is interface/generic and will
> need additional extension pdo_pgsql for application to connect to
> postgresql.
>
> I would still prefer PDO.
>
>>