Jump to content

Multiple sql entries


Dabuel

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/94587-multiple-sql-entries/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/94587-multiple-sql-entries/#findComment-484349
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.