Loading ...
Sorry, an error occurred while loading the content.

How to insert a new 'row'

Expand Messages
  • mwhit007400
    First, I would like to say that this module is quite excellent. Simple, lightweight, easily portable, and self contained. I cannot thank you enough for
    Message 1 of 4 , Aug 2, 2012
    • 0 Attachment
      First, I would like to say that this 'module' is quite excellent. Simple, lightweight, easily portable, and self contained. I cannot thank you enough for releasing it.

      Now, on to my problem. I have recently started working with TaffyDB using an example database that reflects the structure of my final database. I developed the "user" side which makes a bunch of class to the database with very little problem. I have just started on the "admin" side where the admin can get on and edit the database; adding, editing, and deleting data.

      My first attempt at this was extremely simple. Adding a new 'record' and two variables determined from the admin's input. I copied my 'test' example to pastebin so you don't have to open up some foreign files: http://pastebin.com/z1kYcYUc

      If someone could let me know what I am doing wrong I would be most greatful. I have been banging my head against the wall for about two hours now.

      Thanks to anyone who has time to point me in the right direction.
    • Jason Wright
      Here s my new pastebin. http://pastebin.com/Zxn7WZWS I m not sure what your question is I added the db().stringify(); command after you inserted the 2nd row
      Message 2 of 4 , Aug 2, 2012
      • 0 Attachment
        Here's my new pastebin.
        http://pastebin.com/Zxn7WZWS

        I'm not sure what your question is
        I added the db().stringify(); command after you inserted the 2nd row into your database. It works great on my browser! (Firefox) 
        I like the stringify() function! It has been a great debugging tool.

        Your insert command works great- is this your question?


        I concur that TaffyDB has to be one of the best kept secrets for client-side databases-- a lifesaver for me.


        -Jason

        On Thu, Aug 2, 2012 at 4:55 PM, mwhit007400 <mwhit74@...> wrote:
         

        First, I would like to say that this 'module' is quite excellent. Simple, lightweight, easily portable, and self contained. I cannot thank you enough for releasing it.

        Now, on to my problem. I have recently started working with TaffyDB using an example database that reflects the structure of my final database. I developed the "user" side which makes a bunch of class to the database with very little problem. I have just started on the "admin" side where the admin can get on and edit the database; adding, editing, and deleting data.

        My first attempt at this was extremely simple. Adding a new 'record' and two variables determined from the admin's input. I copied my 'test' example to pastebin so you don't have to open up some foreign files: http://pastebin.com/z1kYcYUc

        If someone could let me know what I am doing wrong I would be most greatful. I have been banging my head against the wall for about two hours now.

        Thanks to anyone who has time to point me in the right direction.


      • mwhit007400
        I thought the database db = {} would actually update in the file I am storing it in. Like it would add the new data I am adding with the insert query. So, I am
        Message 3 of 4 , Aug 2, 2012
        • 0 Attachment
          I thought the database db = {} would actually update in the file I am storing it in. Like it would add the new data I am adding with the insert query.

          So, I am still a bit confused about how it works. I just played with the file you sent me and i can insert one new row just fine; so i have record:1 and record:2. When I run the insert function again by inputing data and pressing the submit button I don't get a record:3.

          Does this database only exist for the program instance?
          Is there any way to update the database I am working from in the file with data I am submitted from the user?

          ...I think that's it for now. I sincerely hope that I can write the data to the database in the file.

          -mwhit74


          --- In taffydb@yahoogroups.com, Jason Wright <jasonwright365@...> wrote:
          >
          > Here's my new pastebin.
          > http://pastebin.com/Zxn7WZWS
          >
          > I'm not sure what your question is
          > I added the db().stringify(); command after you inserted the 2nd row into
          > your database. It works great on my browser! (Firefox)
          > I like the stringify() function! It has been a great debugging tool.
          >
          > Your insert command works great- is this your question?
          >
          >
          > I concur that TaffyDB has to be one of the best kept secrets for
          > client-side databases-- a lifesaver for me.
          >
          >
          > -Jason
          >
          > On Thu, Aug 2, 2012 at 4:55 PM, mwhit007400 <mwhit74@...> wrote:
          >
          > > **
          > >
          > >
          > > First, I would like to say that this 'module' is quite excellent. Simple,
          > > lightweight, easily portable, and self contained. I cannot thank you enough
          > > for releasing it.
          > >
          > > Now, on to my problem. I have recently started working with TaffyDB using
          > > an example database that reflects the structure of my final database. I
          > > developed the "user" side which makes a bunch of class to the database with
          > > very little problem. I have just started on the "admin" side where the
          > > admin can get on and edit the database; adding, editing, and deleting data.
          > >
          > > My first attempt at this was extremely simple. Adding a new 'record' and
          > > two variables determined from the admin's input. I copied my 'test' example
          > > to pastebin so you don't have to open up some foreign files:
          > > http://pastebin.com/z1kYcYUc
          > >
          > > If someone could let me know what I am doing wrong I would be most
          > > greatful. I have been banging my head against the wall for about two hours
          > > now.
          > >
          > > Thanks to anyone who has time to point me in the right direction.
          > >
          > >
          > >
          >
        • Jason Wright
          So, the submit button type is a rather fickle button type. It doesn t like being pressed more than once. Here s another option:
          Message 4 of 4 , Aug 3, 2012
          • 0 Attachment
            So, the "submit" button type is a rather fickle button type. It doesn't like being pressed more than once. Here's another option:
            <input type="button" value="Submit Form 1" onclick="javascript:add_scope_section()" />

            Or if you want to pass values to your function from your current form:
            <input type="button" value="Submit Form 1" onclick="javascript:add_scope_section(this.form.new_section.value, this.form.new_scope.value)" />

            And the web page doesn't have access (or methods) to write to itself, so the db= line won't be changed.
             Yes, it stores information only for the session- it is erased as soon as you close the web page, unless you use the db.store() method. This stores it in a moderately sized (5mb per domain 10mb with IE) datafile on the client machine. Another solution is to use a hosted database solution (such as parse.com) to store your information easily with a third party.

            -Jason

            On Thu, Aug 2, 2012 at 10:58 PM, mwhit007400 <mwhit74@...> wrote:
             

            I thought the database db = {} would actually update in the file I am storing it in. Like it would add the new data I am adding with the insert query.

            So, I am still a bit confused about how it works. I just played with the file you sent me and i can insert one new row just fine; so i have record:1 and record:2. When I run the insert function again by inputing data and pressing the submit button I don't get a record:3.

            Does this database only exist for the program instance?
            Is there any way to update the database I am working from in the file with data I am submitted from the user?

            ...I think that's it for now. I sincerely hope that I can write the data to the database in the file.

            -mwhit74



            --- In taffydb@yahoogroups.com, Jason Wright <jasonwright365@...> wrote:
            >
            > Here's my new pastebin.
            > http://pastebin.com/Zxn7WZWS
            >
            > I'm not sure what your question is
            > I added the db().stringify(); command after you inserted the 2nd row into
            > your database. It works great on my browser! (Firefox)
            > I like the stringify() function! It has been a great debugging tool.
            >
            > Your insert command works great- is this your question?
            >
            >
            > I concur that TaffyDB has to be one of the best kept secrets for
            > client-side databases-- a lifesaver for me.
            >
            >
            > -Jason
            >
            > On Thu, Aug 2, 2012 at 4:55 PM, mwhit007400 <mwhit74@...> wrote:
            >
            > > **

            > >
            > >
            > > First, I would like to say that this 'module' is quite excellent. Simple,
            > > lightweight, easily portable, and self contained. I cannot thank you enough
            > > for releasing it.
            > >
            > > Now, on to my problem. I have recently started working with TaffyDB using
            > > an example database that reflects the structure of my final database. I
            > > developed the "user" side which makes a bunch of class to the database with
            > > very little problem. I have just started on the "admin" side where the
            > > admin can get on and edit the database; adding, editing, and deleting data.
            > >
            > > My first attempt at this was extremely simple. Adding a new 'record' and
            > > two variables determined from the admin's input. I copied my 'test' example
            > > to pastebin so you don't have to open up some foreign files:
            > > http://pastebin.com/z1kYcYUc
            > >
            > > If someone could let me know what I am doing wrong I would be most
            > > greatful. I have been banging my head against the wall for about two hours
            > > now.
            > >
            > > Thanks to anyone who has time to point me in the right direction.
            > >
            > >
            > >
            >


          Your message has been successfully submitted and would be delivered to recipients shortly.