<?php$host='localhost';
$user='root';
$pwd='123456';
$db='bbs';
$conn=mysql_connect($host,$user,$pwd) or die("不能连接到服务器");
mysql_query("set names gbk");
mysql_select_db($db,$conn);
//获取id的值
$id=$_GET['id'];
//查询并显示
$sql="select text,work from bbs_txt where id=".$id;
$result=mysql_query($sql,$conn) or die('查询错误');
$row=mysql_fetch_array($result);
$text=$row['text'];
$work=$row['work']; echo "$text";
echo "$work";?>
$id=$_GET['id']; 你写成了$id=$GET['id'];
$user='root';
$pwd='123456';
$db='bbs';
$conn=mysql_connect($host,$user,$pwd) or die("不能连接到服务器");
mysql_query("set names gbk");
mysql_select_db($db,$conn);
//获取id的值
$id=$_GET['id'];
//查询并显示
$sql="select text,work from bbs_txt where id=".$id;
$result=mysql_query($sql,$conn) or die('查询错误');
$row=mysql_fetch_array($result);
$text=$row['text'];
$work=$row['work']; echo "$text";
echo "$work";?>
$id=$_GET['id']; 你写成了$id=$GET['id'];
解决方案 »
- phpmyadmin运行问题
- php程序中怎么实现 - 无刷读取数据库
- 求教用过ssl的大侠
- 怎样让网站的动态地址都变成静态的,新手
- 做个调查,大家开发时都用什么模板引擎?
- checked 问题?
- 怎样才能使用 (列表/菜单)连接到mysql的一个表,并能显示和选择其中的某列的数据,即能像使用delphi那样的下拉式菜单连接数据库的功能
- 求PHP/ASP/JAVA/C++的电子图书(或是自己总结的都可以)
- mail($mail_to,$title,$body,"From: ".$mail_from."\nReply-To: ".$from."\nX-Mailer:ProMail3\r\nContent-Type:text/html
- 为什么我放问php文件是要提示下载
- class的时候,每次连接完数据库之后,怎么执行关闭函数
- 对PHP类与对象有经验的朋友请来一下!
$id=$GET['id'];$id=$_GET['id'];