ok, new question: i'm following yariv's login tutorial.  what i'm
getting is, you store the cookie in the db (in my case mysql), then
base64:encode it and put it in the arg's cookie field...and then,
after redirecting to another component, you get the cookie and
base64:decode it and query the db for it.
the problem is that the decoded key doesn't match the key in the
database, so my query comes up empty.  i've tried storing it as
char(20), varchar(20), binary, and blob...  the way i test it is just
fetching the cookie from the arg and decoding it, and then fetching
the stored cookie of my user, and then sending them both to the view.
each one gets printed like this:
<% show_data(Data) %>
<% Data %>
when i print them out they're visibly different.
so what should i do with the cookie, or with the database, to get this
to work?  this seems like a problem of converting between types but i
don't know how erlang handles that.  thanks for your help!

On Apr 7, 10:39 pm, Liron Greenstein <[EMAIL PROTECTED]> wrote:
> nevermind, i solved this just by restarting yaws.  no idea why that
> worked, since i didn't update the .conf or anything.
>
> more questions coming...
>
> On Apr 6, 3:55 pm, Liron Greenstein <[EMAIL PROTECTED]> wrote:
>
> > this is probably simple to solve, but i've looked through
> > documentation/this site, and haven't found anything.  i want a single
> > database with multiple tables, and different modules will make use of
> > different tables.  So, say in the music app, i have a database called
> > 'music' with a table called 'musician' that has all the info.  Then in
> > musician.erl, I have:
> > table() -> musician.
> > and export that function, and when i start erlydb i pass it 'music' as
> > the name of the db.
> > However, when i compile it, i get:
>
> > debug:erlyweb_compile:114: Generating ErlyDB code for models:
> > "musician.erl "
> > mysql_conn:426: fetch <<"show tables">> (id <0.86.0>)
> > mysql_conn:426: fetch <<"describe user">> (id <0.86.0>)
> > debug:erlydb:355:
>
> > --- To skip foreign key checks, compile with the {skip_fk_checks,
> > true} option
>
> > ** exception exit: {no_such_table,{{module,musician},
> > {table,musician}}}
> >      in function  erlydb:gen_module_code/5
> >      in call from lists:foreach/2
> >      in call from erlyweb_compile:compile/2
>
> > the two confusing things here are: 1) why "describe user"?  I don't
> > refer to any table called "user" in the app, and there's no table
> > called "user" in the db.  and 2) the obvious issue, i do have a table
> > called musician.
>
> > so, what am i doing wrong?  all i'm really trying to do here is use
> > multiple tables within a single db.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"erlyweb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to