If somebody could give me a hand with this... because I'm going nuts!
Basically it's a configuration database to keep track of who has what. It's set up as you've got items (servers, firewalls, software, routers, etc.) and details for those items (name, serial number, os, etc). I was asked to make this as dynamic as possible so have chosen to make it possible to have dynamic drop down lists which can be generated from a table... such as an operating system.
To get around using MySQL variables by accident I tend to name my things in Dutch. 🙂
Here are the pertinent tables:
detail
detailid (primary key)
itemid (foreign key to the item)
typeid (foreign key to "detail_type" which is next)
waarde (the actual value of the detail, eg OS = Windows 2003).
detail_type (list of possible details)
typeid (primary key)
oms (description of the detail, eg Windows 2003)
bron (bron=source, the link to the table if it's got more than one value, like the table list_os)
templateid (next table...)
detail_template (the template for which type of object it is - is it a standard text field or does it need to be treated as a drop down menu?)
templateid (primary key)
template (this is the name of the file that has the correct data, have been using includes)
oms (description of the template)
What I want to do is pass the variable detail_type.typeid when making a new detail, basically saying "I want a new object of this type which automatically grabs the correct name and template type." That all works. But I need the list of things to choose from when creating a new object, eg an operating system. In theory, I should be able to grab the name of the table out of detail_type.bron but I keep getting MySQL errors.
The error I'm getting is 1064, which the MySQL manual tells me is when you have a variable using the name of one of the standard MySQL variables. I don't see this happening... does anybody else?
This is the query I'm using:
SELECT *
FROM {
SELECT bron
FROM detail_type
WHERE detail_type.typeid =6};
detail_type.typeid=6 refers to the type "operating system".
Can anybody give me a heads up for why this is going wrong? I'd be much obliged!