addyking Posted August 27, 2011 Share Posted August 27, 2011 show list of files uploaded by current session user to the database. I want to show different users when they log in to the website...they can see a list of old files that they have uploaded. can anyone tell me the code/script to this.....please, ty Quote Link to comment https://forums.phpfreaks.com/topic/245797-how-to-show-list-of-files-uploaded-by-current-session-user/ Share on other sites More sharing options...
WebStyles Posted August 27, 2011 Share Posted August 27, 2011 post the code you have so far, and whatever errors you're getting please. Quote Link to comment https://forums.phpfreaks.com/topic/245797-how-to-show-list-of-files-uploaded-by-current-session-user/#findComment-1262503 Share on other sites More sharing options...
addyking Posted August 27, 2011 Author Share Posted August 27, 2011 I dont know how to, am new to php. I need something to fetch the number of files and what files the user uploaded to the database earlier. Quote Link to comment https://forums.phpfreaks.com/topic/245797-how-to-show-list-of-files-uploaded-by-current-session-user/#findComment-1262506 Share on other sites More sharing options...
WebStyles Posted August 27, 2011 Share Posted August 27, 2011 all databases are different. The person who creates them chooses the database name, table names, field names, how the tables will link with each other, etc... without knowing those names you cannot do the script. post the code that stores files. Quote Link to comment https://forums.phpfreaks.com/topic/245797-how-to-show-list-of-files-uploaded-by-current-session-user/#findComment-1262510 Share on other sites More sharing options...
addyking Posted August 27, 2011 Author Share Posted August 27, 2011 <p>welcome: <?php echo $_SESSION['user_name'];?></p> <p>There are <?php echo $totalRows_rs1 ?> records</p> <form id="form1" name="form1" method="POST" action="<?php echo $editFormAction; ?>"> <table width="458" border="1"> <tr> <td width="124">Author Name</td> <td width="318"><label for="author"></label> <input type="text" name="author" id="author" /></td> </tr> <tr> <td>Title</td> <td><label for="title"></label> <input type="text" name="title" id="title" /></td> </tr> <tr> <td> </td> <td><input type="submit" name="submit" id="submit" value="Submit" /></td> This is a table its all in dreamweaver. the Session area is from different table, where user login resides. And the recordset is different table where the data is send and stored to database. Now with that echo totalrows i am able to see all the rows of the table. If there any way where i can see only the rows that a specific user has uploaded so that only he is able to alter it. ty Quote Link to comment https://forums.phpfreaks.com/topic/245797-how-to-show-list-of-files-uploaded-by-current-session-user/#findComment-1262532 Share on other sites More sharing options...
WebStyles Posted August 27, 2011 Share Posted August 27, 2011 that is your html code, I asked for the code that stores files, so I can see the database field names. Quote Link to comment https://forums.phpfreaks.com/topic/245797-how-to-show-list-of-files-uploaded-by-current-session-user/#findComment-1262533 Share on other sites More sharing options...
addyking Posted August 27, 2011 Author Share Posted August 27, 2011 I think i will manage the code somehow, can u tell me what i have to do to get it working. like the steps involved in it. Do i have to make a join first to the login table? steps like those. Quote Link to comment https://forums.phpfreaks.com/topic/245797-how-to-show-list-of-files-uploaded-by-current-session-user/#findComment-1262534 Share on other sites More sharing options...
WebStyles Posted August 27, 2011 Share Posted August 27, 2011 Once again: I cannot tell you if you'll need to join two tables or not without seeing your database structure. If your structure is properly built, you might have a table dedicated to file uploads, and in that case all you need is something like: select `fileId`,`filePath`,`fileDescription` from `uploads` where `userId` = $_SESSION['userId'] Quote Link to comment https://forums.phpfreaks.com/topic/245797-how-to-show-list-of-files-uploaded-by-current-session-user/#findComment-1262634 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.