tecmeister Posted July 13, 2008 Share Posted July 13, 2008 I am creating a forum and im having a little problem with the user mysql. The users can register fine, but the problem is when they fill in a new topic it doesn't display and save the username in forumQuestion mysql i have selected. I want it so that it will save the username of who entered question. How do i do so? I must be using the wrong script. Here is the mysql that im using if that helps. $createUsers = mysql_query("CREATE TABLE IF NOT EXISTS `users` ( `id` int(11) NOT NULL auto_increment, `name` varchar(32) NOT NULL, `email` text NOT NULL, `username` varchar(32) NOT NULL, `password` varchar(64) NOT NULL, `age` tinytext NOT NULL, `displayAge` int(11) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ") or die(mysql_error()); echo "User table created\n"; echo "<br />"; $forumTopic = mysql_query("CREATE TABLE IF NOT EXISTS `forumTopic` ( `id` int(11) NOT NULL auto_increment, `topic` varchar(64) NOT NULL, `datetime` varchar(32) NOT NULL, `view` int(4) NOT NULL, `reply` int(4) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ") or die(mysql_error()); echo "Fourm Topic table created\n"; echo "<br />"; $forum_question = mysql_query("CREATE TABLE IF NOT EXISTS `forumQuestion` ( `id` int(11) NOT NULL auto_increment, `username` varchar(64) NOT NULL, `title` varchar(255) NOT NULL, `detail` longtext NOT NULL, `datetime` varchar(25) NOT NULL, `view` int(4) NOT NULL, `reply` int(4) NOT NULL, PRIMARY KEY(`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ") or die(mysql_error()); echo "Forum Question table created\n"; echo "<br />"; $createMain = mysql_query("CREATE TABLE IF NOT EXISTS `main` ( `id` int(11) NOT NULL auto_increment, `title` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ") or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/114577-solved-user-forum-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.