Page 1 of 1

Help Please any help Newbie and i want to Learn

Posted: Wed Mar 25, 2009 1:58 pm
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

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

Posted: Wed Mar 25, 2009 3:52 pm
by waylon999
What is the query that you are currently using?

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

Posted: Wed Mar 25, 2009 7:46 pm
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.

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

Posted: Thu Mar 26, 2009 10:29 am
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