Can somebody please enlighten me on the use of SHOW COLUMNS
specifically in regards to PHP/MySQL because I have not found anything of much use through search.
What I want to do is get all the column names out of a table, then use those to get the correct data from session to do an update.
what i have so far is:
function get_Columns($con, $table){
$sql_statement = "SHOW COLUMNS FROM " . NAME_TABLE_BASE . $table ;
$temp = mysql_query($sql_statement) or die(mysql(error)) ;
return mysql_fetch_array($temp) ;
}
?>
The problem is this is only returning the first column and not all of them. What do I need to change? Also is there anything I can add to $sql_statement
to only get the fields and not all the other info like key type etc?