添加新成员代码工作正常,直到我为我的网站切换网站主机现在它没有,我不知道为什么

时间:2014-10-21 14:12:38

标签: php mysql forms

我在添加新成员页面时遇到问题,我的登录页面也存在类似代码的问题。两者都运行良好,多次测试和方式,然后我切换托管公司。除了这部分,数据库驱动的网站的其余部分仍然可以正常工作。不知道为什么,可能只是需要新鲜的眼睛。我开始使用php和mysql相当新,然后尝试学习更新的版本以保持我的代码升级,此时我无法弄清楚为什么代码不再有效。任何帮助将非常感激。感谢。

页面将运行到这一点,我已经确认使用echo,然后它失败了。页面本身没有加载,只是保持完全空白,并且标签角落中的小加载轮只是旋转和旋转。

$sql="SELECT * FROM table WHERE field LIKE'$username'";
$rs=$db->query($sql);
$arr = $rs->fetch_all(MYSQLI_ASSOC);
// test to make sure there was not an issue loading the db
if($rs != true) {  // start second if in nested section
    // if any errors in reading the db redirect to a general db is down error page
    //close db connection
    mysqli_close($db);
    // redirect header goes here, removed for this post
} else { // else to go with second if
    // get number of rows returned in this case should be 0 or 1
    $rows_returned = $rs->num_rows;
    echo "num of rows are $rows_returned";
} // end second if

0 个答案:

没有答案