www.webdeveloper.com
Results 1 to 4 of 4

Thread: Field populated by javascript from php query

Hybrid View

  1. #1
    Join Date
    Sep 2010
    Posts
    2

    Field populated by javascript from php query

    This is one for some really smart people:

    Okay, so this is what I want to do, I want to have a page that is a list of auction items, and for each list item, show a field with the current bid price - easy to do statically, but I want the current bid price field to by dynamically updated by javascript every few seconds from a php database query.

    I have had no trouble building this page, but what happens is that the javascript will do the php query only once and fill the current bid price field continually with the same value, even if it has been changed in the database.

    I have the javascript function repeating every second, so that is not the issue.

    My php script works nicely, so that is not the issue.

    Just to re-iterate, there is no problem passing a value to javascript from a php sql query, it is in trying to get javascript to refresh the value it gets from the php sql query everytime that it runs.

    I have been working on this for over a year, and have done loads and loads of research, but to no avail. I assume that there is something high-level that I am missing here, not just coding.

    Thanks in advance to everyone.

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Sep 2010
    Posts
    2
    Nice article - one of the first ones I read, and quite similar to what I did.

    The essence of the problem is that this code, like the one I wrote, will pull values from an sql database and display them, but WONT get a different value as the values change in the database.

  4. #4
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    If you poll the database often enough you will.
    At least 98% of internet users' DNA is identical to that of chimpanzees

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles