Date: 06/29/00
- Next message: toby cabot: "[phplib] bug in db_pgsql.inc"
- Previous message: Peter Holm: "[phplib] Error with big arrays as session-variables in session.inc on line 332 ???"
- In reply to: Howard Schultens: "[phplib] Authentication from multiple databases"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Phplib document suggest every database has its own table for sessions and users. So , you'd best use create_database.mysql for every database.
----- Original Message -----
From: Howard Schultens <hs <email protected>>
To: PHPlib User List <phplib <email protected>>
Sent: Thursday, June 29, 2000 6:36 PM
Subject: [phplib] Authentication from multiple databases
Hello,
I'm writing a package for student registration and course scheduling.
For each semester, I have a data base with a table of the students
registering for that semester. A student is supposed to log in using
his/her registration number as user name and birthday as password.
I got this all set up and working fine when I could confine everything
to one semester with the student data table in the same
database as the session data.
Now I have separate databases for different semesters, each containing
table of student data and one common database for the session data.
However, when PHPLIB 6.1/PHP3/MySQL 3.21.33 makes a connection to a
database to authenticate a student, it apparently forgets to return
to the other database for session data. I get the following
error:
Database error: Invalid SQL: update active_sessions set val='$this->in =
\"\"; $this->pt = array();
$this->pt[\"auth\"] = \"1\"; $GLOBALS[\"auth\"] = new Stud_Auth;
$GLOBALS[\"auth\"]->auth = array(); $GLOBALS[\"auth\"]->auth[\"uid\"] =
\"12345678\";
$GLOBALS[\"auth\"]->auth[\"regnum\"] = \"12345678\";
$GLOBALS[\"auth\"]->auth[\"password\"] = \"010400\";
$GLOBALS[\"auth\"]->auth[\"lname\"] = \"Klein\";
$GLOBALS[\"auth\"]->auth[\"fname\"] =
\"Hänschen\"; $GLOBALS[\"auth\"]->auth[\"perm\"] = \"student\";
$GLOBALS[\"auth\"]->auth[\"exp\"] = \"962273687\";
',changed='20000629115947' where
sid='3a9ce6a3edad2e31d4763ae890d7a015' and name='Stud_Session'
MySQL Error: 1017 (Can't find file: 'active_sessions.frm' (errno: 2))
Session halted.
I believe this has to do with the reuse of a link_ID when a database
with the same host/user/password is opened. At least I can get
the error to disappear by a dirty hack using the PHP call
'mysql_select_db' on the link_ID. I would like to know how to
do this properly within PHPLIB.
Thanks,
-- Howard Schultens, Systems admin.
--------------------------------------------------------------------
Dipl.-Phys. H.Schultens Tel: +49 551 39-5914
Zentrum Physiologie FAX: +49 551 39-5923
Humboldtallee 23
37073 Goettingen mailto:hs <email protected>
Germany http://www.neuro-physiol.med.uni-goettingen.de
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>
- Next message: toby cabot: "[phplib] bug in db_pgsql.inc"
- Previous message: Peter Holm: "[phplib] Error with big arrays as session-variables in session.inc on line 332 ???"
- In reply to: Howard Schultens: "[phplib] Authentication from multiple databases"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

