Menu

error on connect to db

Help
2001-05-12
2001-05-21
  • knut olafsen

    knut olafsen - 2001-05-12

    hi,

    i have a problem with authlib 1.94

    every time i want register a new account an error appears:
    "Unknown database failure, please try later."

    i have changed some registration values..also i have create the right table structure..

    that is my confirm table in install.php:

    [code]

    $server = "localhost";
    $username = "root";
    $password = "";
    $database = "authlib";

    mysql_connect($server, $username, $password) or die("mysql conn failed!");
    mysql_select_db($database) or die("db select failed!");

    $query = mysql_query("CREATE TABLE authlib_confirm (
       mdhash longtext,
       username text,
       domain text,
       redir text,
       password text,
       name text,
       email text,
       title text,
       keywords longtext,
       descr longtext,
       cloaking text,
       date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL
    )");

    [/code]

    and that is my confirm code in backend.php:

    [code]

    }
               
                $hash = md5($this->secret.$username);

                $is_success = mysql_query("insert into authlib_confirm values ('$hash', '$username', '$domain', '$redir', '$password', '$name', '$email', '$title', '$keywords', '$descr', '$cloaking' now())");

                mysql_close();

                if (!$is_success) {

                    return $this->error[16];

                }
    [/code]

    i think that is correct..but always the error[16] appears.

    i hope you can help me (if you need some other code..please post it)

    soory about my english..i'm only a german idiot :]

     
    • Mark Silva

      Mark Silva - 2001-05-16

      have you tested your php/msql config?
      Write a test script and and create test db w/test tbl ..... add some info to the table ... "i use phpMyAdmin" download from www.phpwizzard.net ... see if you can acess mysql db and print the contents out on your webpage
      this is only a test ... and shouldnt take long

       
    • Mark Silva

      Mark Silva - 2001-05-16
       
      • Mark Silva

        Mark Silva - 2001-05-16
         
    • knut olafsen

      knut olafsen - 2001-05-21

      i have tested the 2 options..create db and tables with the "install.php" an "authlib.sql" with phpmyadmin (both edited with my values)..and yes..the db and tables are created on the mysql server.

      but the registerfunction in backend.php didn't connect to the server at this point:

      ------------------

                  $hash = md5($this->secret.$username);

                  $is_success = mysql_query("insert into authlib_confirm values ('$hash', '$username', '$domain', '$redir', '$password', '$name', '$email', '$title', '$keywords', '$descr', '$cloaking' now())");

                  mysql_close();

                  if (!$is_success) {

                      return $this->error[16];

      ------------------

      also the orginal authlib script without changes in backend.php works fine

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.