jobs1109 Posted September 6, 2011 Share Posted September 6, 2011 Hi, I am looking for a session tutorial where users can save data to a mysql database and then edit / update/delete only their postings. If you know of a good tutorial please let me know. Thanks D.S Quote Link to comment https://forums.phpfreaks.com/topic/246538-session-tutorials-with-mysql-database/ Share on other sites More sharing options...
voip03 Posted September 6, 2011 Share Posted September 6, 2011 Try google http://www.tizag.com/phpT/phpsessions.php http://www.freewebmasterhelp.com/tutorials/phpmysql Quote Link to comment https://forums.phpfreaks.com/topic/246538-session-tutorials-with-mysql-database/#findComment-1265926 Share on other sites More sharing options...
jobs1109 Posted September 9, 2011 Author Share Posted September 9, 2011 Hi Thanks but I am looking for a tutorials that goes a bit more on how to store data using sessions in a database and then be able to edit, update, delete using sessions. Quote Link to comment https://forums.phpfreaks.com/topic/246538-session-tutorials-with-mysql-database/#findComment-1267271 Share on other sites More sharing options...
Adam Posted September 9, 2011 Share Posted September 9, 2011 You wouldn't store the user's "postings" within the session, only the user's actual data like their username. Quote Link to comment https://forums.phpfreaks.com/topic/246538-session-tutorials-with-mysql-database/#findComment-1267333 Share on other sites More sharing options...
jobs1109 Posted September 13, 2011 Author Share Posted September 13, 2011 How could I get users to edit, delete, and update only their own postings ? Quote Link to comment https://forums.phpfreaks.com/topic/246538-session-tutorials-with-mysql-database/#findComment-1268860 Share on other sites More sharing options...
voip03 Posted September 13, 2011 Share Posted September 13, 2011 For that you need a database. like MySql Quote Link to comment https://forums.phpfreaks.com/topic/246538-session-tutorials-with-mysql-database/#findComment-1268920 Share on other sites More sharing options...
ManiacDan Posted September 13, 2011 Share Posted September 13, 2011 The "session" is a small array that stores variables relevant to the user's current session (the time they've spent browsing your site in the last hour or so). Sometimes the session data can be stored in the database if you have a good reason for it, but otherwise just leave session handling alone. Now, once you have a session of some sort, you will then have a login system which uses that session. The current user's ID and/or username would then be a part of the session. When you perform database queries, make sure to always include the user's ID (and make sure your tables are designed so they all link to a specific user where appropriate). In this way, you can limit all queries to only affecting the items for the currently logged in user. -Dan Quote Link to comment https://forums.phpfreaks.com/topic/246538-session-tutorials-with-mysql-database/#findComment-1268923 Share on other sites More sharing options...
jobs1109 Posted September 15, 2011 Author Share Posted September 15, 2011 Hi , Here is what I got so far , a form where users can login and post thei jobs now I would like to have them edit their own postings. http://www.alwayshawaii.com/Sawh-Network/Hilo-Jobs/User-Login/User-Login.php Quote Link to comment https://forums.phpfreaks.com/topic/246538-session-tutorials-with-mysql-database/#findComment-1269557 Share on other sites More sharing options...
ManiacDan Posted September 15, 2011 Share Posted September 15, 2011 Well, make a page that selects the postings linked to the currently logged in user. Then make a page that can edit a single posting. On the portion of the code that saves the edits to a posting, make sure the posting being edited belongs to the currently logged in user. -Dan Quote Link to comment https://forums.phpfreaks.com/topic/246538-session-tutorials-with-mysql-database/#findComment-1269611 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.