query checking

From: s <stefang(at)bundabergcity(dot)qld(dot)gov(dot)au>
To: pgsql-php(at)postgresql(dot)org
Subject: query checking
Date: 2001-01-22 00:44:20
Message-ID: 3A6B8264.5040902@bundabergcity.qld.gov.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

I am writing a site that
does select/insert SQL commands with users input.

There is a potential hazard if some one tries to execute there
own commands in an input box
eg. the user types into the input box on a form - [ "; delete *
from table; ]

I'm after a regular expression (that'd be nice) or an algorithm to
tell that only one query is being passed to psql at a time.

The query string will be processed if
Either - one SELECT command only
- one INSERT command only
- one UPDATE command only
ELSE - dont process query

Any input would be much appreciated.
thanks,
stef

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Chris Ryan 2001-01-22 13:44:55 Re: query checking
Previous Message Adam Lang 2001-01-18 13:37:16 Re: Order