帮助,我似乎无法将我的数据从特定表复制到另一个表。我已经尝试过这些尝试。
代码 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')");
结果:$查询错误
代码 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')");
}
结果:$查询错误
任何帮助将不胜感激,在此先感谢^^