PHP用户注册的问题

来源:百度知道 编辑:UC知道 时间:2024/09/25 07:22:45
前面写了一个reg.php通过表单POST传递变量
到savereg.php
具体代码如下 :
不管怎么样注册 结果都是用户注册 失败
我是相当的郁闷 希望高手朋友指点下
小弟感激不尽

<?php
session_start();

class save_reg{

private $usernc;
private $userpwd;
private $truename;
private $sex;
private $email;
private $tel;
private $qq;
private $photo;
private $address;

public function __construct($usernc,$userpwd,$truename,$sex,$email,$tel,$qq,$photo,$address){
$this->usernc=$usernc;
$this->userpwd=$userpwd;
$this->truename=$truename;
$this->sex=$sex;
$this->email=$email;
$this->tel=$tel;
$this->qq=$qq;
$this->photo=$photo;
$this->address=$address;
}

public function savereg(){
include_once("conn.php");
$sql=mysql_query("select usernc from tb_yonghu where usernc=&

很有C++风格,我不会用session_register ,但不应该是这个问题.
你把查询语句var_export出来,向上一步步查找,不能停在一个地方.

其实你不用函数做是最简单的,虽然有点傻瓜式但起码也少出错,说实话我不太懂函数,上次看书一看到函数这章就睡了~~

你直接把sql打出来然后放到phpmyadmin执行一下,看看报什么错。