Another Perl+Mysql - Question

They have: 109 posts

Joined: Apr 1999

For an upcomming project that will involve login/passwords being stored in a mysql database, I will need to be able to see if one login already exists before creating new accounts. Can someone give me a brief example of this because I don't have a clue how to look under the specified column (named login).

----------
[Dass]
[Email:[email protected]]-[ICQ:16560402]

They have: 453 posts

Joined: Jan 1999

Hi,

select login from users where login='dass';

or what do you want ?
Grab "SQL for Dumies" or "SQL in 21 days" and your life will be much easier.

ciao
Anti

They have: 109 posts

Joined: Apr 1999

What I will want it to search the members column (2 columns in database) and check if $login is equal to any of them.

For the book, would I buy a mysql specific book, or just sql? (these stupid computer books cost alot of money that I don't have err ;( )

----------
[Dass]
[Email:[email protected]]-[ICQ:16560402]

They have: 453 posts

Joined: Jan 1999

Hi Dass,

could you please describe your DB-setup more exactly ?
You have a Database.
Your have a Members Table.
The Members Table contains to columns ?!
What are the names of those Columns ?

Sql for Dummies costs 20 bucks at barnes&noble.
You pay more for your host each month.

ciao
Anti
ps:
please don't take it personal, but you usually get much better answers if you are more specific about your questions and give more details.

They have: 109 posts

Joined: Apr 1999

Note not taken personally anti Wink

OK
The database contains 3 columns with the names "member", "password" and "email"

Now for creating new accounts, I will need to check the "member" column to see if the member name already exists. How do I specifically choose the "member" column to see if $login==$member.

I have heard alot of bad things about dummies books, have you read sql for dummies?

----------
[Dass]
[Email:[email protected]]-[ICQ:16560402]

They have: 109 posts

Joined: Apr 1999

anti, was that description good enough, or do you needa little more ifno on what I'm talking about to help me?

----------
[Dass]
[Email:[email protected]]-[ICQ:16560402]-[Voice Mail:1-877-309-2286]

They have: 453 posts

Joined: Jan 1999

Hi dass,

sorry, I'm under very heavy pressure right now.

In the doc for mysql are some small perl samples.
They are almost perfect for you.

The select in my first answer does exactly what you want.

select member from members where member='$login';

And just check how many results you get.

btw:
your TABLE contains three columns. and your DATABASE contains that TABLE.

I could write a small example, but my test-system is 2000km away and I have almost no time. maybe when I'll get back (10/99) ... sorry Sad

ciao
Anti

They have: 2,390 posts

Joined: Nov 1998

Where are you staying again Anti?
JP

----------
The Webmaster Promotion and Resource Center.
Visit: http://www.what-next.com

They have: 453 posts

Joined: Jan 1999

Right now im in Hursley (near Southampton) In England.

ciao
Anti
ps:
I don't know if that are 2000km, but it's close (far ??) enough.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.