Help Please any help Newbie and i want to Learn

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
r2ks
Forum Newbie
Posts: 3
Joined: Wed Mar 25, 2009 1:20 pm

Help Please any help Newbie and i want to Learn

Post by r2ks »

Ok i am a NEWBIE.
I am trying to create a php pledge website for my church.
I have the Login Page completed ?
I have the database completed

Database has 2 tables
login----> loginid, username, password

pledge ------> pledgeid, fname,lname, addy, city,state,pledge and loginid

what i am trying to do is when a person logs in say mary she will see her pledges and not everyones.
what is happening is when mary logs in she see every pledge
waylon999
Forum Commoner
Posts: 26
Joined: Mon Mar 23, 2009 5:29 pm

Re: Help Please any help Newbie and i want to Learn

Post by waylon999 »

What is the query that you are currently using?
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Help Please any help Newbie and i want to Learn

Post by califdon »

r2ks wrote:Ok i am a NEWBIE.
I am trying to create a php pledge website for my church.
I have the Login Page completed ?
I have the database completed

Database has 2 tables
login----> loginid, username, password

pledge ------> pledgeid, fname,lname, addy, city,state,pledge and loginid

what i am trying to do is when a person logs in say mary she will see her pledges and not everyones.
what is happening is when mary logs in she see every pledge
It looks like you should have all the user data in the login table, not the pledge table. It should look like this:

Code: Select all

[b]login[/b]:
    loginid
    username
    password
    fname
    lname
    addy
    city
    state
 
[b]pledge[/b]:
    pledgeid
    loginid
    pledgeamt
    pledgedate
You'll need that if you're ever going to be able to get statistics from your database. It's called data normalization.

As to your question about what data to show, when someone logs in, you will have their loginid, and since that's a field in the pledge table, you just use the WHERE clause of the query to limit the results to records with that loginid in them.
r2ks
Forum Newbie
Posts: 3
Joined: Wed Mar 25, 2009 1:20 pm

Re: Help Please any help Newbie and i want to Learn

Post by r2ks »

I am confused i am looking at what you wrote it makes sence but how would the why would the username and password be associated to the Pledge.

Mike logs in he wants to add he has taken a pledge from Mary, steve, and will,
mikes username has to be associated to mary,steve, and will and any other pledge he gets ??
looking at the database it does not look right i am new so please forgive me if i am wrong
Thank you
Post Reply