SQL Database to php website with javascript

I seem to be stuck on a concept in database query and website development.I have a website that will reflect what data is stored in a database and the website needs to change depending on that data: therefore, my menu system will not be hardcoded in. It builds my menu system based off a query of all the models …

via PHP Website Development » Search Results » ajax:

SQL Database to php website with javascript

I seem to be stuck on a concept in database query and website development.
I have a website that will reflect what data is stored in a database and the website needs to change depending on that data: therefore, my menu system will not be hardcoded in. It builds my menu system based off a query of all the models in my database. The action of clicking on the menu will show tables without changing the page (a simple javascript “showtables” function). like so:
function showTables(TABLE_NAME)

if(TABLE_NAME != “PRINTER_TABLE”)

document.getElementById(“PRINTER_TABLE”).style.display =”none”;

if(TABLE_NAME != “show_ALL_PRINTERS”)

document.getElementById(“show_ALL_PRINTERS”).style.display =”none”;

document.getElementById(TABLE_NAME).style.display =”block”;
}I did not include all of my other if statements because there are about 15 of them. These statements will hide everything and the only show the formatted table of “TABLE_NAME” at the end of that script.
My problem is that, if all of the data will not be hardcoded in either HTML or PHP, I need to pass into my function “showTables” a model type or ID that will come from my query.
My Menu system code snipet:

  • Printer Parts