#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    1
    Rep Power
    0

    Javascript database


    Hi guys i was wondering if its possible to make a JavaScript database i would like to to store comments photos ect if i could do this how would i do it any help would be great thanks Dan
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,296
    Rep Power
    7170
    If you don't mean JavaScript running in a web browser, then yes, it could be done.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,777
    Rep Power
    348
    Originally Posted by E-Oreo
    If you don't mean JavaScript running in a web browser, then yes, it could be done.
    Actually there is a database available inside JavaScript. It was supposed to be part of the new HTML5 standard under the name "Web SQL Database", but apparently this standardization effort has been stopped:

    http://blog.darkcrimson.com/2010/05/local-databases/
    http://www.w3.org/TR/webdatabase/
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags.
    http://forums.devshed.com/misc.php?do=bbcode#code

    Tips on how to ask better questions:
    http://tkyte.blogspot.de/2005/06/how-to-ask-questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html
  6. #4
  7. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,296
    Rep Power
    7170
    In that case you could actually use the HTML5 local storage feature too.

    That would be using a database implemented by the JavaScript engine though, not implementing a database engine in JavaScript itself (which is the meaning I took away from "make a JavaScript database").
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    3
    Rep Power
    0
    Originally Posted by danielpherlio
    Hi guys i was wondering if its possible to make a JavaScript database i would like to to store comments photos ect if i could do this how would i do it any help would be great thanks Dan

    Create a Database

    // Create DB and fill it with records
    var friends = TAFFY([
    {"id":1,"gender":"M","first":"John","last":"Smith","city":"Seattle, WA","status":"Active"},
    {"id":2,"gender":"F","first":"Kelly","last":"Ruth","city":"Dallas, TX","status":"Active"},
    {"id":3,"gender":"M","first":"Jeff","last":"Stevenson","city":"Washington, D.C.","status":"Active"},
    {"id":4,"gender":"F","first":"Jennifer","last":"Gill","city":"Seattle, WA","status":"Active"}
    ]);

IMN logo majestic logo threadwatch logo seochat tools logo