PHP/MySQL不显示所有结果

PHP/MySQL不显示所有结果,php,mysql,Php,Mysql,有人能帮我找出我的问题吗? 我在显示数据库中的某些结果时遇到问题。 我试图通过在查找表中查找来显示用户的所有设置,但结果会跳过其他变量。 例如,它正在显示(错误): relationship_status : In a relationship<br> eye_color : green<br> religion : christian (catholic)<br> body_type : average<br> education : don't

有人能帮我找出我的问题吗?
我在显示数据库中的某些结果时遇到问题。 我试图通过在查找表中查找来显示用户的所有设置,但结果会跳过其他变量。

例如,它正在显示(错误):

relationship_status : In a relationship<br>
eye_color : green<br>
religion : christian (catholic)<br>
body_type : average<br>
education : don't say<br>
looking_for : don't say<br>
drinker : don't say<br>
这就是我得到的。
如果我不得不猜测的话,我会说这与MySQL语句执行太快有关?

MySQL语句执行得太快?有趣的想法,但没有。代码是按顺序执行的。我使用node.js的另一个原因…@danielpsc谢谢!使其工作。尝试错误报告(E\U错误);在顶部。非常好-抱歉,只是不小心删除了我的评论,所以现在评论列表看起来很奇怪!:)
orientation : straight<br>
relationship_status : In a relationship<br>
hair_color : black<br>
eye_color : green<br>
ethnicity : black<br>
religion : christian (catholic)<br>
politics : liberal<br>
body_type : average<br>
children : don't say<br>
education : don't say<br>
income : don't say<br>
looking_for : don't say<br>
smoker : don't say<br>
drinker : don't say<br>
$lookup_table_names = array('orientation'=>$orientation,'relationship_status'=> $status,'hair_color'=>$hair_color,
                            'eye_color'=>$eye_color,'ethnicity'=>$ethnicity,'religion'=>$religion,
                            'politics'=>$politics,'body_type'=>$body_type,'children'=>$children,'education'=>$education,
                            'income'=>$income,'looking_for'=>$looking_for,'smoker'=>$smoker,'drinker'=>$drinker
);

foreach ($lookup_table_names as $tablename => $val) {
    $query = "SELECT value FROM lookup_".$tablename." WHERE id = ? LIMIT 1";

    if($stmt = $mysqli -> prepare($query)){
        $stmt -> bind_param('i',$val);
        $stmt -> execute();
        $stmt -> bind_result($myvalue);
        $stmt -> fetch();
        echo '<br><br>'.$tablename.' : '.$myvalue.'<br><br>';
    }else{
        printf($stmt->error);
    }
}