问题是挺奇怪。首先指出一点错误:
if (mysql_query($sql1)=="1") 
mysql返回值是个整数,不一定是1。如果query查询符是update,insert,delete返回值可能是true或false继续找错中ing

解决方案 »

  1.   

    tel char(20)) not null default '',着行多了个半边)号
    然后修改成这样:
    <?
    $hostname = "localhost";
    $username = "root";
    $password = "";
    $dbname = "test";
    $myconn=mysql_pconnect($hostname,$username,$password);
    if(!@mysql_select_db($dbname)) {
    print "# Couldn't select database <br>\n"; 
    exit; 
    } else { 
    // Inform user of success 
    print "# Database selected successfully <br>\n"; 

    $sql1 = "CREATE TABLE reguser ( id int(11) not null AUTO_INCREMENT PRIMARY KEY,
    userid char(20) not null default '',
    sex char(2) not null default '',
    age smallint(6) not null,
    tel char(20) not null default '',
    email char(50) not null default '',
    address char(10) not null default '')";mysql_query($sql1);?>