mark103 Posted October 1, 2010 Share Posted October 1, 2010 Hi guys, I am thinking of create an free email system by sending an messages using with a username. Would I have to store the messages via in mysql? If I can do that, then I just curious that how would a user delete their messages if their messages is display on php page? What method would I have to use? Quote Link to comment Share on other sites More sharing options...
fortnox007 Posted October 1, 2010 Share Posted October 1, 2010 Just fetch the row id's from your table 'messages' for the specific user of table 'users' Than let them delete the rows from table 'messages' with the selected id, by using a form (with post method) which does a delete. So you need a select query and a Delete query. also a table messages and a table users Besides ofcourse a complete user registration and login system. Quote Link to comment Share on other sites More sharing options...
mark103 Posted October 1, 2010 Author Share Posted October 1, 2010 Just fetch the row id's from your table 'messages' for the specific user of table 'users' Than let them delete the rows from table 'messages' with the selected id, by using a form (with post method) which does a delete. So you need a select query and a Delete query. also a table messages and a table users Besides ofcourse a complete user registration and login system. Yeah, I know that I have to delete the rows from the table with selected id. As I am not sure how to delete the messages on php page as there are no delete button included for automatically messages. Here it is an example messages I get on php page: from: myusername subject: test message 1 messages: hello, how are you today? hope you are well! from: myusername subject: test message 2 messages: I am good thanks. what you been up to? from: myusername subject: test message 3 messages: Not alot... You workin? from: myusername subject: test message 4 messages: Oh that's cool. See you later As you can see, there is no delete button for each message on the php page. If I would have to add the automatically code that would adds the button for each message without the needs for me to input the code for each message then please post the example code that would do the method that automatically add the buttons for each message... Thanks! Quote Link to comment Share on other sites More sharing options...
fortnox007 Posted October 1, 2010 Share Posted October 1, 2010 Uhm, i am not sure but if i understand you right you what me to completely code your stuff? Why don't you just try to do the following. Write a script that fetches the messages from 1 particular user an post your php here. Ones we see that, we know exactly your table names. After that we can create a simple submit button that executes a delete query. A little effort from your side would be nice, since it helps you to learn this language instead of just copy and pasting someone's work. People here always helped me really good most often by just telling the name of a specific function or pointing me in the right direction. Besides that I am also still learning, but I am eager to do so. And what is the fun in getting the answers right from the start. If you just want a submit button in html do this: <form action="action_script.php" method="post"> <input type="submit" name="submit" value="delete record" /> </form> Now this form will perform an action which is on action_script.php (so that's where your delete query will be) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.