How can I convert SQL statements written in asp into php statements?

Source: Internet
Author: User
How to convert SQL statements written in asp into php? setrs = server. createobject (& quot; adodb. recordset & quot;) 'create rs object setrsuser = server. createobject (& quot; adodb. how can I convert SQL statements written in asp into php statements?
Set rs = server. createobject ("adodb. recordset") 'create an rs object
Set rsuser = server. createobject ("adodb. recordset") 'create an rs object
SQL = "select JF_Rule_TimeDiff, JF_Rule_Count, JFValue_Every from JF_Rule"
Rs. open SQL, conn, 1, 1
'The process of obtaining system parameters
If not rs. eof then
JF_Rule_TimeDiff = rs ("JF_Rule_TimeDiff") 'interval
JF_Rule_Count = rs ("JF_Rule_Count") 'valid clicks during the interval
JFValue_Every = rs ("JFValue_Every") 'points that are valid for each click
End if
Rs. close
If (len (vipurl) = 0) then ',
'Jump ----- write the jump page here
Response. write nextpage
Response. end
Else 'is a promotional connection that is valid for users.
SQL = "select User_ID, User_Code, User_UserName, User_Login_time, User_Login_IP, User_Login_Count from C_User where User_Code = '" & vipurl &"'"
Rs. open SQL, conn, 1, 1
If not rs. eof then
Userid = rs ("User_ID ")
', User_FromUser, User_JF, User_ToUserCount, User_ToAllCount

Else
'Jump ----- write the jump page here
Response. write nextpage
Response. end
End if
Rs. close
End if
'--------- The number of valid clicks. the following shows whether the click is valid.
SQL = "select isnull (count (1), 0) as logincount from User_GetJF where LoginIP = '" & IP & "' and datediff (hour, LoginTime, cast ('"& now () &"' as datetime) <= "& JF_Rule_TimeDiff &""
'Response. write SQL
'Response. end
Rs. open SQL, conn, 1, 1
If not rs. eof then
Logincount = rs ("logincount") 'to obtain the number of valid clicks
End if
If (logincount> = JF_Rule_Count) then' is invalid if the number of clicks exceeds the system parameter setting
Isvalid = 0
End if
Rs. close
SQL = "insert into User_GetJF (User_ID, User_GetJFValue, User_GetMethod, LoginIP, LoginIPArea, IsValid, login_Url) values (" & userid & "," & Tags & ", 'promotional access ', '"& IP &"', '"& LoginIPArea &"', "& isvalid &", '"& login_Url &"')"
'Write the user promotion detail table
Rs. open SQL, conn
'Rs. close
Set rsupdate = server. createobject ("adodb. recordset") 'create and update the rs object
If (isvalid = 1) then', if this click is valid, the user point table is updated.
SQL = "update C_User set User_ToAllCount = isnull (User_ToAllCount, 0) + 1, User_JF = isnull (User_JF, 0) +" & JFValue_Every & "where User_ID =" & userid

Rs. open SQL, conn

End if
'Jump ----- write the jump page here
Response. write nextpage

------ Solution --------------------
Actually, it is similar. That is, the link symbol is different.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.