Re: My Project

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 ;

:)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux