Re: [PHP-DB] use php variable within postgresql query

[email protected] (Aziz Saleh) Fri, 9 Jun 2023 10:53:13 -0400
Newsgroups php.db
Message-ID <CAPJtNhXNyK+0b2RP4OYc-PPBEHCV1LkepYNN82pnyZ53jg8ZkA@mail.gmail.com>
--0000000000006d178005fdb389a4
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Read and understand these, should help you:

https://www.php.net/manual/en/language.types.array.php

Basically its databasecolumnname get param is not defined (set) causing the
query to fail also.

On Fri, Jun 9, 2023 at 5:06=E2=80=AFAM e-letter <[email protected]> wrote:

> Readers,
>
> Suppose:
>
> $query=3D$_GET['databasecolumn'[;
>
> $anotherquery=3Dpg_query($databaseconnection, 'SELECT * FROM
> databasename WHERE databasecolumnname=3D"'.$query.';"');
>
> Two errors are reported:
>
> PHP Notice:  Undefined index: databasecolumnname
>
> PHP Warning:  pg_query(): Query failed: ERROR:  column ";" does not exist
>
> Any advice please?
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--0000000000006d178005fdb389a4--