Hello, I'm working onthe below peice of code basically when i call a table from the database I dont want to have to write all the code each time hence the function, The only part I'm having trouble with is specifying the column heading without hard codeing it see below.
mysql_fetch_assoc
function return_table_item($item, $table)
{
$table_item="SELECT $item FROM $table";
$table_item_results =mysql_query($table_item);
while ($item_return=mysql_fetch_assoc($table_item_results)){
echo '<a href=' . $item_return['$item'] . '.php target="menu_results"><li>' . sanitize_text_from_tables($item_return['$item']]) . '</li></a>';
}
how can I request the $item column using the function variable $item.
Any help appreciated.