Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: username and password verification from a table in Postgres

by spq (Friar)
on May 22, 2002 at 18:21 UTC ( #168540=note: print w/ replies, xml ) Need Help??


in reply to username and password verification from a table in Postgres

In the context of the other replies on the code you have already received, and that you seem to be interested in general advice.

It is almost never the best idea use 'SELECT *' in a coded database query where you plan on using the values of any particular fields. It can cause a lot of headaches if the table layout ever changes, not to mention reads more like handwaving if anyone has to maintain the code someday. It's preferable to request fields specifically, such as 'SELECT passwd,user', even if you really want all the fields in the table.

Other than the question I raise in my direct reply, for what you seem to be trying to do, Randals' suggestion count(*) seems the most concise. If you can borrow a copy of 'Writing Apache Modules with Perl and C' (or but it if it is directly appropriate for your task), it contains a section on authenticating users that has some lessons and further references that you might find useful.
HTH,
Sean


Comment on Re: username and password verification from a table in Postgres

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://168540]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2014-10-21 01:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (94 votes), past polls