Welcome Guest, Not a member yet? Register   Sign In
Session Class, database
#1

[eluser]Sinclair[/eluser]
Hi,

I'm using the Session Class to store sessions on the database, I need to know if this class only do operations of INSERT and UPDATE to the database or does also UPDATE operations?

Best Regards,
#2

[eluser]n0xie[/eluser]
[quote author="Sinclair" date="1266431620"]Hi,

I'm using the Session Class to store sessions on the database, I need to know if this class only do operations of INSERT and UPDATE to the database or does also UPDATE operations?

Best Regards,[/quote]
Wait what?
#3

[eluser]rogierb[/eluser]
*rushes the UPDATE into an operations room whilst calling session*

You might want to refrase. After reading it 3 times I had a less civil response in mind than n0xie gave.

I have no idea what you are asking.
#4

[eluser]Sinclair[/eluser]
Hi,

I'am using PostgreSQL as database, and using also Views to write to the table that store sessions. In PostgreSQL to do INSERTS, UPDATES and DELETES operations in Views we have to define Rules. What I need to know is what statements are done in the CI_SESSIONS table, INSERT and DELETE only or also UPDATE?

PS: Sorry for my bad english.

Best Regards,
#5

[eluser]n0xie[/eluser]
SELECT / INSERT / DELETE / UPDATE
#6

[eluser]Sinclair[/eluser]
Thanks for the reply.

Best Regards,
#7

[eluser]Sinclair[/eluser]
Another question about the Session Class with Database.

I'm using PostgreSQL as database, and I have created the "ci_sessions" table, muck like the table in the documentation:

Code:
CREATE TABLE IF NOT EXISTS  `ci_sessions` (
session_id varchar(40) DEFAULT '0' NOT NULL,
ip_address varchar(16) DEFAULT '0' NOT NULL,
user_agent varchar(50) NOT NULL,
last_activity int(10) unsigned DEFAULT 0 NOT NULL,
user_data text NOT NULL,
PRIMARY KEY (session_id)
);

If I put the field USER_DATA as NOT NULL, does not work, If I change it to NULL, it works and saves user_data info in the field. This is a bug with PostgreSQL or the information in the documentation is wrong about the NOT NULL user_data field?

Best Regards,
#8

[eluser]rogierb[/eluser]
Mysql is a not that hard on you when you leave a field empty, even is is set up as NOT NULL. By default the user_data field is empty or at least ''.

So I guess you have to set it up in PosgreSQL as NULL to get it working.
#9

[eluser]Sinclair[/eluser]
Ok, thanks for the reply.

Best Regards,
#10

[eluser]Sinclair[/eluser]
To share with the community,

The DDL to create the "ci_sessions" table in PostgreSQL is:

Code:
CREATE TABLE "ci_sessions" (
"session_id" varchar(40) NOT NULL DEFAULT 0,
"ip_address" varchar(16) NOT NULL DEFAULT 0,
"user_agent" varchar(50) NOT NULL,
"last_activity" int4 NOT NULL DEFAULT 0,
"user_data" text,
  PRIMARY KEY("session_id"),
  CONSTRAINT "ckeck_last_activity" CHECK(last_activity >= 0)
);

Best Regards,




Theme © iAndrew 2016 - Forum software by © MyBB