hi
I will try to explain my problem as much as i can....
I am designing a message system in php. I have a messages table which have the following fields: receiver_id,sender_id,subject,message,date
I can display the messages for a particular user by querying the messages table and returning all the records which have that members id in the reciever_id field.I display the messages in a html table with columns:sender,subject and date.
Now what i want is that when the user clicks on the subject of the message he should be taken to that message.(maybe by giving the hyperlink to subject). I am not able to work out how to do this.(how to set a variable in php equal to the subject of message and then query the database using the subject can be one option, but i am not able to figure it out how to do this..how to get the subject field content if there are many messages and how to figure out which hyperlink the user clicked?)
Any suggestion or help would be appreciated.
Thanks
MANISH
provide hyperlink for record in database
Moderator: General Moderators
-
manish_7in
- Forum Newbie
- Posts: 4
- Joined: Thu Feb 26, 2004 8:03 pm
the hyperlink should provide the primary key or enough info to obtain the record...
from your table field list, i don't see a primary key, though it could be a concatenated key of several fields...usually a pk is some knd of autonumber key or even a random key generated by a function (kina like phpsessid) since your table could have multiple records having the same information (ie one sender could send one receiver many notes on the same day on the same subject...an you don't want to pass the message around...
from your table field list, i don't see a primary key, though it could be a concatenated key of several fields...usually a pk is some knd of autonumber key or even a random key generated by a function (kina like phpsessid) since your table could have multiple records having the same information (ie one sender could send one receiver many notes on the same day on the same subject...an you don't want to pass the message around...
-
manish_7in
- Forum Newbie
- Posts: 4
- Joined: Thu Feb 26, 2004 8:03 pm