I am having a hard time trying to grasp how to do what I need to do here. I have a Database and inside I have a table (siteIndex) and each record has a list of user friendly names, all the other tables are number based names: 0, 1, 2, 3 and so on… Inside the numbered tables, the fields consist of an epoch time, and then a variable number of fields named d1, d2, d3, d4 and so on… There are also fields named t1, t2, t3, t4 and so on. The reason I say they field names vary in quantity, is that the number of logic sensors (d1 – dX) and temperature sensors (t1 – tX) are different quantities at every site location.
When I go to site.php?id=0 I want that page to look up the siteIndex table, scoop up all the names of the sensors and the quantity that corresponds to the “0” table, then lookup the site table “0” and get the most resent record and display the name in the left column of a table then the corresponding data in the same table but in the right column.
But, if the site only have 5 logic sensors, I only want the table to have that many rows. Some sites have more, some have less.
If there is an easy way to show what my database and tables look like so you can better understand it, let me know.