Re: CGI::Session with MySQL Driver



Alexandre Jaquet wrote:

> Fabian Pilkowski a écrit :
> > Subject: CGI::Session with MySQL Driver
> >
<snip>
> >
> > http://search.cpan.org/~sherzodr/CGI-Session-3.95/Session/MySQL.pm
> >

>
> I've read this doc, but it's doesn't seem to have example with new
> defined field
>
> I want to store user_name in session table
>
> $dbh is previously initialized
>
> $CGI::Session::MySQL::TABLE_NAME = 'session';
> my $SESSION = new CGI::Session("driver:MySQL",$query, $dbh);
> $SESSION->store($dbh,$id,'',"user_name => $username");
>
> error message :
>
> Can't connect to data source , no database driver specified and
> DBI_DSN env var not set at
> C:/indigoperl/perl/site/lib/CGI/Session/MySQL.pm line
>
> Can't get DBI::db=HASH(0x1f21af0)->{Handle}: unrecognised attribute
> at C:/indigoperl/perl/site/lib/CGI/Session/MySQL.pm line 131

Why are you calling store? This is not mentioned in the documentation
and should be considered an internal method, ie don't call it yourself.

What does

$dbh->ping()

return?

Is your script failing at new or at store?

Until you learn to ask yourself this sort of question you aren't going
to make much progress.

Mark
.



Relevant Pages

  • Re: OO versus RDB
    ... It boils down to the same thing: bunches of bytes, mostly managed by the underlying OS, with a language specific layer above. ... In C we can *store* data structures in memory (let's just call it ... I have stored multi-gigabyte multi-res images in an OODBMS and it works ...
    (comp.object)
  • Re: OO versus RDB
    ... main memory storage? ... In C we can *store* data structures in memory (let's just call it ... Suppose this CAD drawing needs to persist. ...
    (comp.object)
  • Re: BigNum -- Floating Point
    ... <snip English description of method> ... Mixed-base floating point, perhaps? ... use a big amount of space to store it. ... Then either you take the loss of precision like a man; ...
    (comp.programming)
  • Re: Why tuples use parentheses ()s instead of something else like <>s?
    ... <SNIP> ... The small store to which you can walk and where you likely know the ... about Italian culture IMHO is that it appears to understand that some ... And it is truly heart-breaking to see the beautiful countryside around ...
    (comp.lang.python)
  • Re: Dealing with mianderson and his ilk
    ... > I also told him I didn't own the games, ... I worked in a book store when I was at college. ...
    (rec.sport.football.college)