Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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.

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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2016-10-21 23:10 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (291 votes). Check out past polls.