If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

Stuck in database development

I am looking to setup a database for my "test server"/offline access to collect data as I find it so it will be easier to compile the data to put the info online in a more accurate fasion.

I have a basic jist of how to do the database, but I do have a few questions.

Qustion 1) I know for displaying row information you use $row['row_name'], would $table['table_name'] work the same way? Essentially what I am tryinging to do is build the database so that I can output the information in a tabular format...

The table name is fluid I have 16 folders to work from and want the code to self adjust (for the table name) per folder (1 html table per folder). The Row Names will but output'ted code via a normal echo, but the row data will be set. btw the above produces a blank page.. and php.ini has "errors on"

Question 2) When entering data. How could I mesh the data together for instance on one day I find a code name and a spare part number for a particular board, then two weeks later I find a real name or a retail part number.

Would also like to build an html data entry page instead of using the phpMyAdmin interface..

ok so after a lot of tweaking I got the code redone and it works to the point the the table row data is displayed. I hard coded the table header for now til I figure out how to display table names like the rows..

I had a little trouble with the sorting, was using DESC, but determined ASC was what I wanted for my purpose..

Not I need to figure out how to fill the voids (blank spots in the html table based off the database..

Users who have thanked Old Pedant for this post:

The website this database that I am collecting information for currently contains 16 folders one for each OEM manufacturer (15 known and a folder for unknown/OEM[i.e. unbranded unique design]). with pages for each motherboard in the appropriate folder.

The project is a huge one that has moved into its 13th year and I have come to the conclusion that its time to pool the data collected into a db versus having a bazillion different places to look while building the web pages. Mainly to help aleviate errors in the data.

The original concept of the project was based on desktop boards only but as time wears on we are uncovering retail manufactures for laptop and Workstation/Server boards

[Normally, you would not assign the boardid in the INSERT INTO allBoards; you would let MySQL assign it for you. But I did it here for demo purposes.)

Do you HAVE to do this? No. But depending on what queries you may later make against the DB, it may prove invaluable. Each field you have there that potentially has a list of values in it needs to be examined to figure out if it should be done as above (known as a "1 to many relationship" or, sometimes, a "lookup table").

Even the fields that only hold a single value might need this treatment. The most likely candidate, as I see it (but you would need to carefully review your data to know for sure) is "CPUInfo". But there well could be others.

A *good* DB design is one that will allow you to later make most any query against it that you can dream up. Just one possible example:
"Find all boards that support an AMD Athlon XP3400+ CPU and that have at least 4
RAM slots and at least 3 PCI Express x1 Slots."

You won't easily be able to support such a query if you have multiple pieces of information in a single DB field.

An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.

[Normally, you would not assign the boardid in the INSERT INTO allBoards; you would let MySQL assign it for you. But I did it here for demo purposes.)

Do you HAVE to do this? No. But depending on what queries you may later make against the DB, it may prove invaluable. Each field you have there that potentially has a list of values in it needs to be examined to figure out if it should be done as above (known as a "1 to many relationship" or, sometimes, a "lookup table").

Even the fields that only hold a single value might need this treatment. The most likely candidate, as I see it (but you would need to carefully review your data to know for sure) is "CPUInfo". But there well could be others.

A *good* DB design is one that will allow you to later make most any query against it that you can dream up. Just one possible example:
"Find all boards that support an AMD Athlon XP3400+ CPU and that have at least 4
RAM slots and at least 3 PCI Express x1 Slots."

You won't easily be able to support such a query if you have multiple pieces of information in a single DB field.

Fortunately you get the jist of what I am trying to accomplish. The final design of the database is coming together using insight from this..

Gonna work on getting things setup, I may be back with more questions but the insight has at least steered my in the right direction...

MySQL said:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'REFERENCES allBoards(boardID)
) ENGINE INNODB' at line 4

So the premise of Auto Increment is the database takes care of numbering, if that is the case why am I being forced to enter a number per entry? shouldn't the first entry start at 1, and each entry after go from there?

Trying to pupulate the allBoards table with info.. And coincidentally even though I created it as allBoards its showin as allboards..

I am not sure if it is the version of MySQL or not that is causing the hangup, but having the constraint line in the create block as you have it, it produced the error posted above.. The formatting went loopy from mySQL to here, but it was entered as you wrote it.

I did manage to pick up a couple more books covering php/mysql so hopefully I can finally grasp things better.

I haven't gotten around to trying it out yet, but I am going to sometime soon. Haven't had the spare time to put into the project, but definitely need to get going on it... Figures just about the time I get some free time, I break my glasses..