Re: My Project

From: Date: Tue, 19 Jul 2005 17:30:47 +0000
Subject: Re: My Project
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-218987@lists.php.net to get a copy of this message
Paul Waring wrote:
On Tue, Jul 19, 2005 at 09:50:06AM -0700, George B wrote:
My money is being stored in a database. And I want everythign to be in PHP, no java script. And the BUY!! Button is a input button from a form. :)
Well in that case you probably want something like this (after you've checked to see whether the user is logged in etc): $sql = "UPDATE users SET money = money - 10 WHERE id = " . $_SESSION['user_id']; assuming of course that you have a table called users where the money for each one is stored and you're keeping the user_id in the $_SESSION superglobal. It's a bit difficult to help further without a bit more information. :) Paul well what kind more information do you want to know? I can provide you with all the info.
By the way. Here is my table. CREATE TABLE b_users ( userID bigint(21) NOT NULL auto_increment, username varchar(60) NOT NULL default '', password varchar(255) NOT NULL default '', status int(20) NOT NULL default '0', posts bigint(20) NOT NULL default '0', email varchar(255) NOT NULL default '', validated int(11) NOT NULL default '0', keynode bigint(21) NOT NULL default '0', sig tinytext NOT NULL, banned varchar(255) NOT NULL default 'no', rank varchar(255) NOT NULL default '0', usepm int(11) NOT NULL default '1', AIM varchar(50) NOT NULL default '', ICQ varchar(50) NOT NULL default '', location varchar(255) NOT NULL default '', showprofile smallint(6) NOT NULL default '1', lastposttime bigint(20) NOT NULL default '0', tsgone bigint(20) NOT NULL default '0', oldtime bigint(20) NOT NULL default '0', avatar varchar(255) NOT NULL default '', photo varchar(255) NOT NULL default '', rating bigint(255) NOT NULL default '0', totalvotes bigint(20) NOT NULL default '0', votedfor longtext NOT NULL, rps int(11) NOT NULL default '1', rpsscore bigint(20) NOT NULL default '0', lasttime bigint(20) NOT NULL default '0', PRIMARY KEY (userID) ) TYPE=MyISAM AUTO_INCREMENT=6 ; :)

« previous php.general (#218987) next »