-
auto silk
hello all , i got a small problem and hope that someone can help me with it
i am trying to add free silk to new accounts and i have tried allot of different register pages from everywhere and none of them seam to work for me so i made my own and have it working about 90% and just need a small bit of help with the last part , anyways here is the problem and the command line
$mssql->dbQuery("insert into TB_User (StrUserID, password, Name, Email, reg_ip, sec_primary, sec_content) values ('$usr', '$pwd', '$pwdentered', '$email', '$ip', 3, 3)");
$mssql->dbQuery("insert into SK_Silk (JID, silk_own, silk_gift, silk_point) values ('$row[JID]','5000','0','0')");
-----------------------------------------------------
and this works perfectly except for one part which is the '$row[JID]' it just wont put in the user's jid number it will put everything else in and create the silk account but it comes out like this => 0 5000 0 0
so what i need to know is what command do i need to put in place of $row[JID] to get it to get the users JID to give the account the 5000 silk ?
please if anyone can help me with this i will be very happy , thanks
-
Re: auto silk
im not too good on php or even sqldrv syntax, so this are the step.
$mssql->dbQuery("insert into TB_User (StrUserID, password, Name, Email, reg_ip, sec_primary, sec_content) values ('$usr', '$pwd', '$pwdentered', '$email', '$ip', 3, 3)");
next save the value of this query on a php variable maybe like
$jid= $mssql->dbQuery("select JID from TB_User where StrUserID = '$usr'"); , this search and stores the value of jid on $jid
next is:
$mssql->dbQuery("insert into SK_Silk (JID, silk_own, silk_gift, silk_point) values ('$jid','5000','0','0')");
hope you can convert what i explained top php. or anyone can do the right code for you ( i work using odbc)
-
Re: auto silk
nope that didnt help but i do honestly thank you for the help , not many people on here seam to want to help anyone much so thank you for trying , but it still does the same thing only puts a zero in place of the JID so i think i am missing some kind of "fetch array" or something.
-
Re: auto silk
Code:
@$register = odbc_exec($connect, "INSERT INTO TB_User(StrUserID, password, Name, Email, sex, certificate_num, reg_ip, sec_primary, sec_content) VALUES ('".$user."', '".md5($password)."', '".$name."', '".$email."', '".$sex."', '".$SPass."', '".$ip."', '3', '3')");
if ($register) {
$find = odbc_fetch_array(odbc_exec($connect, "SELECT * FROM TB_User WHERE StrUserID = '".$user."'"));
$gift = $find["JID"];
odbc_exec($connect, "INSERT INTO SK_Silk(JID, silk_own) VALUES (".$gift.", ".$silk.")");
you can try and convert this to sqldrv, is working perfect on my reg page, but is odbc
$register = write the account info into account table
$find = finds all the data of the newly created account
$gift = filter the data to get only the JID of the newly create account
and last part writes into account table the newly created account JID and silk
its working, you need to convert it to sqldrv/mssql