ÎÒ×Ô¼ºÐ´µÄÕâÌõ£¬²»ÕýÈ·£¬×ÜÊDzéѯ²»µ½£¬Ë³´ø¿´¿´ÊÇʲôÎÊÌâ°¡ "SELECT * from UName WHERE UserName= '+TName+' AND PassWord= '+Psw""SELECT * from UName WHERE UserName= '"+TName+"' AND PassWord= '"+Psw+"'" wo han a "SELECT * from UName WHERE UserName='" +TName+"' AND PassWord= '"+Psw+ "'"; ÄãÊÔÊÔ²»¼Ó'ºÃÏñÒ²¿ÉÒÔ¡£
´íÎó SQL code:
"SELECT * from UName WHERE UserName= '+TName+' AND PassWord= '+Psw"
Â¥Ö÷ʵ¼ÊÉÏÄãÕâ¾äÖ´ÐгöÀ´¾Íû°Ñ±äÁ¿¸³Öµ½øÈ¥£¬Õû¸ö¾ÍÊÇÒ»¸öconst str£¬ 2Â¥Õý½â "SELECT * from UName WHERE UserName= '+TName+' AND PassWord= '+Psw"
ÔÚÕâÀïÃæTName²»ÊDZäÁ¿£¬Ö»ÊÇTNameÁË "SELECT * from UName WHERE UserName= '" +TName+"' AND PassWord= '"+Psw + "'" ÕâÑù²ÅÐÐ