// The Function
function sendmessage($to,$from,$viewer,$subject,$message,$time){
mysql_query("INSERT INTO `message` (to,from,viewer,topic,message,time) VALUES ('$to','$from','$viewer','$subject','$message','$time')");
}
// Calling The Function
sendmessage(1,2,3,topic,message,1000);
// The SQL
CREATE TABLE `message` (
`ID` int(11) NOT NULL auto_increment,
`to` int(11) NOT NULL default '0',
`from` int(11) NOT NULL default '0',
`viewer` int(11) NOT NULL default '0',
`topic` varchar(50) NOT NULL default '0',
`message` text NOT NULL,
`time` int(11) NOT NULL default '0',
PRIMARY KEY (`ID`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 PACK_KEYS=1 AUTO_INCREMENT=2 ;