Jump to content

Software Database


misterph

Recommended Posts

I'm a newbie when it comes to PHP and MySQL, but i've managed so far just using my IF statements heh.

I'm a techy for a school and we currently log everything on paper with reguards to each workstation. We basically have a table on paper listing all the software packages and precedures for setting up workstations.

I'm wanting to make a website using PHP and MySQL which will list all the software and display what softwares installed when I click on the workstation name.

Now i have a few ideas as to prehaps i should go about it. For example... 2 tables,

1: Software
- ID
- Name

2: Computers
- ID
- ComputerName

(this is where i get stuck, do i just create about 30 new rows? e.g softwareID1, softwareID2 and make the values 1 or to indicate thats installed? or do i create the 30 odd new rows and put the corrisponding software id?...)

- softwareID1
- softwareID2
- etc etc

Also... I have not yet tired arrays, I was thinkin that prehaps if i had 1 field on the computers table for a long strong with software ID's seperated with a space then explode it and query each to find the software title?

I'm sure you guys are prehaps alot more confident at answering this as i was writing it. Please help me, im sure there's a more simple way.

Thanks for anyhelp, much apprecaited!

phil

Link to comment
Share on other sites

What you need is a third table that contains the the computer ID and the software ID. I think it's called a Relational Database [a href=\"http://www.htmlgoodies.com/primers/database/article.php/3478051#setup\" target=\"_blank\"]HTML Goodies[/a] has a good beginners article about databases.
Link to comment
Share on other sites

// relational_table
id
SoftwareID
ComputerID

"select * from relational_table where SoftwareID = 7"


This will give you all the computer id's which have the software installed which has a softwareID of 7.

If you wanted to know what was installed on a particular computer you could then do this;

"select * from relational_table where ComputerID = 3"

So you end up with the SoftwareID's of all the software installed onto computer number 3.

Hope this makes sense.
Link to comment
Share on other sites

Aaaah, GOD i can't beleive i was that blank. Thanks ever soo much mate, you've just woken me up :)

Cheers again wisewood - your truely wise [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /]

phil
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.