Dabuel Posted March 5, 2008 Share Posted March 5, 2008 Hi, Hoping i can explain this as best i can. Im writing a small cms that basically keeps records. The basis is this: I have multiple sites with each site containing multiple PC's. As happens i need to regularly change hardware on any of these PC's as it dies. Now i want my little cms to keep record of what i have changed. This is easy enough, i have written the form to enter specific data when a change is done and submit it too a database (site, host, replaced, reference, date & notes). That all works fine. The problem is with retrieving the records. I have written the code to do that, i enter a site and the code retrieves all entries for that site. The problem is that a client pc could have had hardware changed on it before. So when a 2nd entry is made for that pc it shows in the site list 2 times with different entry dates. Im wondering if there is anyway to code it so it will only show up a particular host once. Then when clicked it will list all entries for it. I have it now so when a client is clicked the site will then show all entries. Just need to be able to check if the client has been listed already and if it has, don't relist it. Any ideas or need i supply more info/code examples? Quote Link to comment Share on other sites More sharing options...
corbin Posted March 5, 2008 Share Posted March 5, 2008 Look into mysql WHERE causes. Quote Link to comment Share on other sites More sharing options...
Dabuel Posted March 5, 2008 Author Share Posted March 5, 2008 I have WHERE clauses. $data = mysql_query("SELECT * FROM data WHERE site = '$site'") or die(mysql_error()); Problem is that will list everything in the 'store' column. Which is what i want but i want to some how say if you see the same entry in the 'pc' column only display it once. Im not sure if this is possible or not. 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.