帮助,似乎我无法将我的数据从特定的表复制到另一个表。我尝试过这些尝试。
代码1:
$ queryzx = odbc_exec($ conn,“SELECT * FROM tempmember WHERE userid ='$ usernamez'”);
$usernamexx = odbc_result($queryzx, 'userid');
$passwordxx = odbc_result($queryzx, 'passwd');
$ignxx = odbc_result($queryzx, 'usernick');
$genderxx = odbc_result($queryzx, 'sex');
$emailxx = odbc_result($queryzx, 'email');
$query = odbc_exec($conn, "INSERT INTO member (userid, usernick, sex, passwd, vip, email)
VALUES ('$usernamexx', '$ignxx', '$genderxx', '$passwordxx', 1, '$emailxx')");
结果:$ query错误
代码2:
$queryzx = odbc_exec($conn, "SELECT * FROM tempmember WHERE userid='$usernamez'");
$resultx = odbc_free_result($queryzx);
while($transf = odbc_fetch_array($resultx))
{
$usernamexx = $transf['userid'];
$passwordxx = $transf['passwd'];
$ignxx = $transf['usernick'];
$genderxx = $transf['sex'];
$emailxx = $transf['email'];
$query = odbc_exec($conn, "INSERT INTO member (userid, usernick, sex, passwd, vip, email)
VALUES ('$usernamexx', '$ignxx', '$genderxx', '$passwordxx', 1, '$emailxx')");
}
结果:$ query错误
任何帮助将不胜感激,提前谢谢^^
答案 0 :(得分:1)
如果$genderxx
是位值,则应在b
语句中使用b'$genderxx'
之前使用INSERT
答案 1 :(得分:0)
感谢所有帮助人员。我强迫自己将$ genderxx切换到varchar。在我的情况下哪个会好的。