[FAQ] Creating a new element
This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.
-
-
step 1: add new column to users table
ALTER TABLE uni1_users ADD COLUMN `coin` double(50,0) NOT NULL DEFAULT '0';
run this code on your database under user table,
step 2 : if you need to update it and save while you are refreshing the page you need to add this column on class.PlanetRessUpdate.php
If you do so, you can increase and decrease it with $USER['coin'] -= 5000; ( for example )
step 3: if you skip and dont update PlanetRessUpdate.php then you need to update $USER['coin'] with database query as follows,
when coin decreased,
$sql = "UPDATE %%USERS%% SET coin = coin - :newCoin WHERE id = :userId;";
$db->update($sql,array(
':newCoin' => $USER['coin'] - 5000
)); -
Thank you bro, I will apply your information.
-
and works?
-
Share
- Facebook 0
- Twitter 0
- Google Plus 0
- Reddit 0