This programme shows all the fields in a table of a database in MySQL.

/*******************************************************
*     MYCPLUS Sample Code - https://www.mycplus.com     *
*                                                     *
*   This code is made available as a service to our   *
*      visitors and is provided strictly for the      *
*               purpose of illustration.              *
*                                                     *
* Please direct all inquiries to saqib at mycplus.com *
*******************************************************/



mysql_list_fields


\n");
	print("\n");
	print("Name\n");
	print("Type\n");
	print("Length\n");
	print("Flags\n");
	print("\n");

	//loop over each field
	for($i = 0; $i < mysql_num_fields($dbResult); $i++)
	{
		print("\n");

		print("" . mysql_field_name($dbResult, $i) . "\n");
		print("" . mysql_field_type($dbResult, $i) . "\n");
		print("" . mysql_field_len($dbResult, $i) . "\n");
		print("" . mysql_field_flags($dbResult, $i) . "\n");

		print("\n");
	}

	//close HTML table
	print("\n");
?>