循环转晕了
$sql="select * from href where id=$id order by link ";
$query=mysql_query($sql);
while($array=mysql_fetch_array($query)){
?>

}?>
这是一个大的 但是我想改成在ID 不是1 2 的时候才这样 所以然后这里
$sql="select * from href where id=$id order by link ";
$query=mysql_query($sql);
if($id!==1 and $id!==2){
while($array=mysql_fetch_array($query)){
?>

}}
?>
elseif($id==1){

}
elseif($id==2){

}
怎么放在那个循环里面 转晕掉了·· 其实就是 不知道 这东西 该放哪里 我尝试了好几个地方都不对 头都大了
------解决方案--------------------
$array{"link"}; ? 你在哪儿看的这种写法?错误的。 应该是$array["link"],方括号括起来的
建议你换一个专业点的编辑器,例如notepad++,eclipse,都可以对PHP语法高亮。另外switch语句更适合你的这种情况。
- PHP code
<?php $sql="select * from href where id=$id order by link "; $query=mysql_query($sql); if($id!==1 and $id!==2){ while($array=mysql_fetch_array($query)) { ?> <td height="30"> <img src="/static/imghwm/default1.png" data-src="list.files/biao_33.gif" class="lazy" style="max-width:90%" style="max-width:90%" align="absMiddle" alt="循环转晕了解决方法" > <a href="list.php?id=<?php%20echo%20%24id;?>"> <?php echo $array["link"]; ?> </a> </td> <?php } //对应while } //对应if else if($id==1){ // 2 ?> <td height="30"> <img src="/static/imghwm/default1.png" data-src="list.files/biao_33.gif" class="lazy" style="max-width:90%" style="max-width:90%" align="absMiddle" alt="循环转晕了解决方法" > <a href="content.php?id=<?php%20echo%20%24id;?>"> <?php echo $array["link"]; ?> </a> </td> <?php } // 对应上面的else if($id==1) // 2 else if($id==2){ // 3 ?> <td height="30"> <img src="/static/imghwm/default1.png" data-src="list.files/biao_33.gif" class="lazy" style="max-width:90%" style="max-width:90%" align="absMiddle" alt="循环转晕了解决方法" > <a href="content.php?id=<?php%20echo%20%24id;?>"> <?php echo $array["link"]; ?> </a> </td> <?php } // 对应elseif 3 ?><div class="clear"> </div>

phpisusedforsendendemailsduetoitsignegrationwithservermailservicesand andexternalsmtpproviders,自动化notifications andMarketingCampaigns.1)设置设置yourphpenvironcormentswironmentswithaweberswithawebserverserverserverandphp,确保themailfunctionisenabled.2)useabasicscruct

发送电子邮件的最佳方法是使用PHPMailer库。1)使用mail()函数简单但不可靠,可能导致邮件进入垃圾邮件或无法送达。2)PHPMailer提供更好的控制和可靠性,支持HTML邮件、附件和SMTP认证。3)确保正确配置SMTP设置并使用加密(如STARTTLS或SSL/TLS)以增强安全性。4)对于大量邮件,考虑使用邮件队列系统来优化性能。

CustomHeadersheadersandAdvancedFeaturesInphpeMailenHanceFunctionalityAndreliability.1)CustomHeadersheadersheadersaddmetadatatatatataatafortrackingandCategorization.2)htmlemailsallowformattingandttinganditive.3)attachmentscanmentscanmentscanbesmentscanbestmentscanbesentscanbesentingslibrarieslibrarieslibrariesliblarikelikephpmailer.4)smtppapapairatienticationaltication enterticationallimpr

使用PHP和SMTP发送邮件可以通过PHPMailer库实现。1)安装并配置PHPMailer,2)设置SMTP服务器细节,3)定义邮件内容,4)发送邮件并处理错误。使用此方法可以确保邮件的可靠性和安全性。

ThebestapproachforsendingemailsinPHPisusingthePHPMailerlibraryduetoitsreliability,featurerichness,andeaseofuse.PHPMailersupportsSMTP,providesdetailederrorhandling,allowssendingHTMLandplaintextemails,supportsattachments,andenhancessecurity.Foroptimalu

使用依赖注入(DI)的原因是它促进了代码的松耦合、可测试性和可维护性。1)使用构造函数注入依赖,2)避免使用服务定位器,3)利用依赖注入容器管理依赖,4)通过注入依赖提高测试性,5)避免过度注入依赖,6)考虑DI对性能的影响。

phperformancetuningiscialbecapeitenhancesspeedandeffice,whatevitalforwebapplications.1)cachingwithapcureduccureducesdatabaseloadprovesrovesponsemetimes.2)优化

ThebestpracticesforsendingemailssecurelyinPHPinclude:1)UsingsecureconfigurationswithSMTPandSTARTTLSencryption,2)Validatingandsanitizinginputstopreventinjectionattacks,3)EncryptingsensitivedatawithinemailsusingOpenSSL,4)Properlyhandlingemailheaderstoa


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

DVWA
Damn Vulnerable Web App (DVWA) 是一个PHP/MySQL的Web应用程序,非常容易受到攻击。它的主要目标是成为安全专业人员在合法环境中测试自己的技能和工具的辅助工具,帮助Web开发人员更好地理解保护Web应用程序的过程,并帮助教师/学生在课堂环境中教授/学习Web应用程序安全。DVWA的目标是通过简单直接的界面练习一些最常见的Web漏洞,难度各不相同。请注意,该软件中

Atom编辑器mac版下载
最流行的的开源编辑器

VSCode Windows 64位 下载
微软推出的免费、功能强大的一款IDE编辑器

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

ZendStudio 13.5.1 Mac
功能强大的PHP集成开发环境