$this->你的在一个类中,这个类完整的代码呢?
解决方案 »
- apache日志中的日期格式如何转换成mysql中的datetime
- zend studio中如何转换文件编码?
- 请帮我解释一下一个PHPmySql语句,在线等
- 又来了,PHP发邮件不支持中文路径。
- 当我在地址栏里输入“http://localhost/?mod=process”
- ZendGuard-5_5_0.exe 加密后 php 无法访问?
- 邮件发送问题_诚请高手指点
- 初来轧道,简单问题,php怎么来实现包含页面的代码,
- 求 上传文件时服务器超时 解决办法
- 如何将数据类型转换为Long型,settype(var,"long"),出错?
- 这种PHP语法是啥回事
- 关于apache2.x+php5.2x的大文件 上传内存占用
class login
{
private $userName="root";
private $userPwd="1234";
private $dbName="test";
private $serverName="localhost";
function __construct()
{
//连接数据库
$this->conn=mysql_connect($this->serverName,$this->userName,$this->userPwd);
//选择数据库
$this->my_db=mysql_select_db($this->dbName,$this->conn);
mysql_query("set names gb2312"); //设置编码格式
if($this->my_db){
echo"数据库连接成功";
}}
?>
如果连接成功,会显示“数据库连接成功”,可结果为什么不对那,说程序错误,请修改谢谢
类 login 的定义未结束,单独执行会报错
Parse error: syntax error, unexpected end of file
}
new login;