How to update the current page to show new content? I am currently displaying a list of MySQL database table names, such as table1, table2, table3.

Each table name will be a link; if users click on it, it will display them the data contained in that table. 

One way I know I can do this is to create a Drupal page that contains the content of "table1", so that when a user clicks on "table1", they are taken to this page and can see the data of "table1".

However, this soon becomes un-manageable if I have a large databases with many tables.

I'm not quite sure if Drupal can work in this way, but I would like it so that when a user clicks on a table link (either table1 or table2 and so on), the current or a generic page will then be updated with the content of the table chosen and be updated with its content.
I am not sure what functionality you are trying to build and if adding PHP code inside a Drupal node is the right way to do it. But assuming that is what you would like to do, here are the steps to achieve what you want:


Create a Drupal node (say the nid of it is NID) and add the following PHP code inside it

$table_name = arg(2); // This grabs the 3rd argument of the page menu path (note: the 1st argument is indexed 0)
print $table_name; // Replace this with PHP code to fetch and print data in the table represented by $table_name

When you are making table1, table2 etc links make sure the URL that they point to is node/NID/&lt;table_name&gt; where &lt;table_name&gt; is table1, table2 respectively.