MySQL client version: 5.0.51a
I got two tables called: Members and avatar. In members I got both user and coins.
The other one is called Avatar with price and name columns.
--
-- Table structure for table `avatar`
--
This is how the avatar table looks like
`id` int(11) NOT NULL auto_increment,
`name` varchar(41) NOT NULL default '',
`price` int(50) default NULL,
`nick` varchar(50) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3
--
-- Table structure for table `members`
--
This is how the members table looks like
`id` int(11) NOT NULL auto_increment,
`user` varchar(30) NOT NULL default '',
`pass` varchar(41) NOT NULL default '',
`name` varchar(50) NOT NULL default '',
`email` varchar(50) NOT NULL default '',
`coins` int(25) default '0',
`savatar` varchar(15) NOT NULL default 'bullet.gif',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;
So I tell again:
I want to take the price value from the name in avatar and minus that with the coins value for the logged in user.
Also going to need somehow "check" if the users coins is more or equal with the price.
I've been searching for a long time how to complete this "buy"-script but I need some serious help.