脚本宝典收集整理的这篇文章主要介绍了php – 使用计数器和数组在循环中获取多个,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
到目前为止,这是我的代码:
<?PHP $i = 0; $statement = $conn->PRepare("SELECT * From users WHERE id = :id"); $statement->bindParam(":id",$friendListIDs[$i],PDO::PARAM_STR); $friendListIDs = explode($details['friends']," "); while($i <= count($friendListIDs)) { $statement->execute(); $row = $statement->fetch(); echo "<img src='../img/friend_icon.png' alt='' align='left' /> <span> <a href='#'>".$row['Firstname']." ".$row['surname']."</a> <br /> <a href='#'>100% wishes fulfilled</a> </span><br /><br />"; $i++; } ?>
以上是脚本宝典为你收集整理的php – 使用计数器和数组在循环中获取多个全部内容,希望文章能够帮你解决php – 使用计数器和数组在循环中获取多个所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。