hallsofvallhalla wrote:i am not sure what you are saying. Nothing in my sql needs to be fixed. It works perfectly.
This is the original sql file given with the tutorial videos in first post.
Code: Select all
-- --------------------------------------------------------
--
-- Table structure for table `players`
--
CREATE TABLE IF NOT EXISTS `players` (
`id` int(9) NOT NULL AUTO_INCREMENT,
`name` varchar(21) NOT NULL,
`email` varchar(55) NOT NULL,
`level` smallint(3) NOT NULL,
`exper` int(11) NOT NULL,
`password` varchar(32) NOT NULL,
`hpoints` mediumint(3) NOT NULL,
`attack` mediumint(3) NOT NULL,
`defense` mediumint(3) NOT NULL,
`maxhp` int(6) NOT NULL,
`spoints` int(6) NOT NULL,
`maxspoints` mediumint(6) NOT NULL,
`gold` int(11) NOT NULL,
`creature` int(6) NOT NULL DEFAULT '0',
`pclass` varchar(31) NOT NULL,
`location` varchar(21) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
--
-- Dumping data for table `players`
--
INSERT INTO `players` (`id`, `name`, `email`, `level`, `exper`, `password`, `hpoints`, `attack`, `defense`, `maxhp`, `spoints`, `maxspoints`, `gold`, `creature`, `pclass`, `location`) VALUES
(6, 'halls', 'halls', 2, 140, '9d7f1b1e4bd4ec1d534770320ff2111b', 42, 7, 6, 50, 7, 40, 197, 10, 'Warrior', 'Fordale Woods');
-- --------------------------------------------------------
Now as you can see there are no defaults set for:
`hpoints` mediumint(3) NOT NULL DEFAULT '0',
`attack` mediumint(3) NOT NULL DEFAULT '0',
`defense` mediumint(3) NOT NULL DEFAULT '0',
`maxhp` int(6) NOT NULL DEFAULT '0',
`spoints` int(6) NOT NULL DEFAULT '0',
`gold` int(11) NOT NULL DEFAULT '0',
`location` varchar(21) NOT NULL DEFAULT '0',
When i did the reguser.php modification from: or die "Could not register user" to: or die mysql(error) to debug what was wrong with it, it gave me this error in value: there is no default value set for gold, hpoints etc etc, so i gave it a default value of DEFAULT '0' so now it see's the default as 0 and fills it in with the appropriate values given by registration form
Hope this clears up a few misunderstandings, sorry for my bad english.