我之前确实发过帖子,但无法正确解释我的问题,也无法解决。这就是我所拥有的。
$shoutlines = file($shout_file);
$aTemp = array();
foreach($matches['user'] as $user) {
$aTemp[] = "'" . $user . "'";
}
$user = implode(",", $aTemp);
$rara = "SELECT * FROM accounts WHERE username IN ( $user )"; // Tried this statment both as a query and prepared statement
$getlevel = $db->query("SELECT * FROM accounts WHERE username IN '( ".$user." )'"); // Tried this both as a query and prepared statement
//$getlevel->bind_param('s', $user);
//$getlevel->execute();
//$level = $getlevel->get_result();
//$getlevel->store_result();
while($getdb = $getlevel->fetch_assoc()){
//output the html
for($i = 0; $i < (1000); $i++)
{
if(isset($shoutlines[$i]))
{
$shoutline = preg_replace('/<\/div>\n/', ' ', $shoutlines[$i], 1);
echo showSmileys($shoutline) . "<div class='delete'><a href='javascript: delete_shoutline({$i});' title='Delele'>delete</a></div></div>";
}
}
}
我在for
循环中有一个while
不会在其中运行的循环,如果我将for
循环移到它之外while
它工作正常,但我需要它在while
循环中检查用户的帖子标题、能力等,这些已保存在我的数据库中。我已经展示了到目前为止我在确定问题时所做的尝试,如果查询、绑定或执行未显示为真,但现在得到了命中,我已经尝试消除错误。已提取此代码,因此您的阅读能力不会太混乱,对此的任何帮助将不胜感激。