Code Snippets Php

/*
Database info below, database name is categories
CREATE TABLE `categories` (
`id` int(11) NOT NULL auto_increment,
`category` varchar(25) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
#
# Dumping data for table `categories`
#
INSERT INTO `categories` VALUES (1, 'php');
INSERT INTO `categories` VALUES (2, 'asp');
INSERT INTO `categories` VALUES (3, 'javascript');
INSERT INTO `categories` VALUES (4, 'visual basic');
INSERT INTO `categories` VALUES (5, 'javascript');
*/
$connection = mysql_connect ("localhost","username", "password");
$db = mysql_select_db ("categories",$connection);
function listCat()
{
$sql_query = mysql_query("SELECT category, id FROM categories");
echo "";
mysql_free_result($sql_query);
}
echo "

Select:";
listCat();
echo "
";
?>