PHP:使用mysqli(syntaxe objet)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP:使用mysqli(syntaxe objet)相关的知识,希望对你有一定的参考价值。
<?php /* how to create connexion (4th parameter = default database) */ /* how to verify connexion */ } /* how to set the default charset to use */ if (!$mysqli->set_charset("utf8")) { } /* how to use real_escape_string on string */ $nom = $mysqli->real_escape_string($nom); $mail = $mysqli->real_escape_string($mail); $tel = $mysqli->real_escape_string($tel); /*how to get data in a table with a while */ $query = "SELECT nom, mail, tel FROM ufr_jury ORDER by nom;"; $ressource = $mysqli->query($query); while($result = $ressource->fetch_assoc()){ echo "<tr>"; echo "<td>".$result['nom']."</td>"; echo "<td>".$result['mail']."</td>"; echo "<td>".$result['tel']."</td>"; echo "</tr>"; } /* how to free result ressource */ $ressource->close(); /* how to close connection */ $mysqli->close(); ?>
以上是关于PHP:使用mysqli(syntaxe objet)的主要内容,如果未能解决你的问题,请参考以下文章
有报错: syntax error, '[' in D:\xampp\htdocs\DVWA\vulnerabilities\sqli\