摘要: 一、不管什么程序,function name(){}, for(){}, ….这太多了,不说也知道什么用了。 二、$str{4}在字符串的变量的后面跟上{}大括号和中括号[]一样都是把某个字符串变量当成数组处理。 三、{$val}这种情况就是我遇到的问题,这时候大括号起的作用就是,告诉PHP,括起来 阅读全文
posted @ 2018-11-06 16:40 南瓜壳 阅读(2716) 评论(0) 推荐(0) 编辑
摘要: <?php //获取url参数 $msgId = $_GET['id']; #var_dump($msgId); require_once("connect.php"); $sql = "select msgs.title,msgs.content,msgs.time,users.name from 阅读全文
posted @ 2018-11-06 12:00 南瓜壳 阅读(146) 评论(0) 推荐(0) 编辑
摘要: <?php //获取数据库中的所有留言 require_once("connect.php"); //执行数据库查询 $sql="select msgs.id,msgs.title,users.name,msgs.time from msgs,users where users.id = msgs. 阅读全文
posted @ 2018-11-06 10:37 南瓜壳 阅读(1542) 评论(0) 推荐(0) 编辑
摘要: <?php //获取数据库中的所有留言 require_once("connect.php"); //执行数据库查询 $sql = "select * from msgs"; $results = mysqli_query($link,$sql); //处理查询结果 while($row = mys 阅读全文
posted @ 2018-11-06 09:53 南瓜壳 阅读(6609) 评论(0) 推荐(0) 编辑
摘要: <?php$host="localhost"; //主机$db_user="root"; //用户名$db_pass="root"; //密码$db_name="message"; //数据库名$timezone="Asia/Shanghai"; $link=mysqli_connect($host 阅读全文
posted @ 2018-11-06 09:52 南瓜壳 阅读(145) 评论(0) 推荐(0) 编辑