SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Client side and mysql

    I know php can be manipulated with some of these. But this may be a stupid question but wanted to make sure I'm clear on it.

    Can Javascript, Ajax, or Javascript xml do initial pulling out of a mysql server database? Please let me know thank you.

  2. #2
    SitePoint Addict svcghost's Avatar
    Join Date
    Oct 2010
    Posts
    288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope. JavaScript can only do stuff on the client. You must use a server-side scripting language like PHP to get information from a MySQL database.

    You can use AJAX to pull information from an XML file though: http://www.w3schools.com/AJAX/ajax_database.asp

  3. #3
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Isn't that Ajax example fetching data from a database though?

    Otherwise if it isn't but looks like it really is, thanks very much I didn't think so, but knew it was 2011 so thought maybe there were some changes I didn't know about. Probably the same thing with prostgstre database also or however you pronounce that one also. That's such a hard one for me to pronounce. Thanks a lot man.

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,460
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)
    The info may very well be coming from a database, but javascript can't pull it out on its own.

    AJAX makes HTTP requests and can deal with text and XML (which is a formatted text string).

    JSON - javascript object notation - is javascript (array/object) as a formatted text string.

    So basically the javascript needs to go to a file that returns the database info as a string - i.e. JSON or XML

    Off Topic:

    eva bevo convert2media scam

  5. #5
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There's JSON now huh? Gosh they just keep coming out with em don't they. Well all that sounds pretty complicated so guess I'll stick with PHP, But thanks for letting me know there are more ways even if more complicated. Thanks for your replying to me as well .

  6. #6
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by Jonie View Post
    There's JSON now huh? Gosh they just keep coming out with em don't they.
    Yep, HTML 4 in 1999, XHTML in 2000, and JSON in 2001. What will they come up with next?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •