How to Myql version Auto Cubi?
MSSQL trigger (in auto cubi gold)
Quote:
create TRIGGER [Insert_cash] ON [dbo].[users]
FOR INSERT
AS
BEGIN
DECLARE @ID int
SELECT @ID= ID FROM INSERTED
BEGIN
insert into usecashnow (userid, zoneid, sn, aid, point, cash, status,creatime) values (@ID, 1, -1, 1, 0, 500000, 0, GetDate())
END
END
i useing DB mysql.
how to Auto Cubi mysql query?
help me.
Re: How to Myql version Auto Cubi?
Supposing you want to add it in your php register page.
Put this after the adduser query, this should do the same things, $Login is the name of the login name variable,
sorry for my english :/.
$result2 = mysql_query("SELECT * FROM users WHERE name='$Login'") or die("can't find ID");
$row2 = mysql_fetch_array( $result2 );
$ID = $row2['ID'];
$TIME = $row2['creatime'];
MySQL_Query("INSERT INTO usecashnow (userid, zoneid, sn, aid, point, cash, status, creatime) VALUES ($ID, 1, -1, 1, 0, 500000, 0, '$TIME')") or die (mysql_error());
Re: How to Myql version Auto Cubi?
@ droopy0064
ur support very thx! :)
but i want create account registed before a few minute auto send cubi gold system..
me too enlish poor =)..
Re: How to Myql version Auto Cubi?
it seems that the user must login and logout twice before he get is cubi, I've just done quick test but I'm not sure, in this case, it give you some minute :)
Re: How to Myql version Auto Cubi?
Ah~!!!
i'm understand !
veryveryveryveryveryveryveryveryveryveryveryvery thx!!
test ok ~~
:)
Re: How to Myql version Auto Cubi?
after testing, user must login once, if he don't, he's never credited.
the server update cubi all 10 minute, so the user must wait this 10 minute for get is cubi.
Re: How to Myql version Auto Cubi?
$result2 = mysql_query("SELECT * FROM users WHERE name='$Login'") or die("can't find ID");
$row2 = mysql_fetch_array( $result2 );
$ID = $row2['ID'];
$TIME = $row2['creatime'];
MySQL_Query("INSERT INTO usecashnow (userid, zoneid, sn, aid, point, cash, status, creatime) VALUES ($ID, 1, -1, 1, 0, 500000, 0, '$TIME')") or die (mysql_error());
if u do just this you will have problems whit players u!XD il not say more XD
Re: How to Myql version Auto Cubi?
@optiplex
Could you explain what problems, your post is useless if you don't say WHY.
I use it on my server, create 10 account and they all get their cubi, so please, explain...
Re: How to Myql version Auto Cubi?
if i say the bug all the players.....nvm il send u a pm....XD
Re: How to Myql version Auto Cubi?
Anybody know how to cub-gold for more than one person?
to all that are in the server?
a cub-gold automatic
for all
i using MySQL + Linux
Re: How to Myql version Auto Cubi?
in mysql 5+ support triggers
here insert_cubi trigger
Code:
DELIMITER $$
USE `users`$$
CREATE TRIGGER `insert_cubi` AFTER INSERT
ON `<Table Name>` # change to account table name
FOR EACH ROW BEGIN
INSERT INTO `usecashnow` (`userid`, `zoneid`, `sn`, `aid`, `point`, `cash`, `status`, `creatime`)
VALUES (NEW.ID, 1, -1, 1, 0, 500000, 0, NOW());
END$$
DELIMITER ;
MySQL Docs Helps :D
http://dev.mysql.com/doc/refman/5.0/...er-syntax.html
Re: How to Myql version Auto Cubi?