mysql - One PHP Template Page, Call Different Tables with Hyperlinks -
i have table called c33062 displays data rows in page. have twenty other mysql tables same structure , information, different data. instead of creating page each, i'd create hyperlinks each calls links table information. statement is:
$query = "select id, year, price_avg_sold, price_sqft, pct_list_sold, adom, sold_nu, sold_chg, year_1, year_2, year_3, year_4, year_5, year_6, year_7, year_8, year_9, year_10 c33062";
so in essence, i'd make hyperlinks each table, c33063, c33064, c33065 etc when clicked, call particular table's data template page.
what correct way hyperlink table?
set table name variable in each link , variable value. example
http://www.name.com?tabe=30063 table 30063
http://www.name.com?tabe=30064 table 30064
and table value $table = $_get['table'];
then use variable in query code below:
$query = "select id, year, price_avg_sold, price_sqft, pct_list_sold, adom, sold_nu, sold_chg, year_1, year_2, year_3, year_4, year_5, year_6, year_7, year_8, year_9, year_10 ".$table;
Comments
Post a Comment