dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 1 of 1

Thread: Posting query results

  1. #1
    Join Date
    Aug 2007
    Posts
    10

    Getting query results from PHP back to AJAX

    Hi Folks,

    I have a function that queries my database and collects the expected data. The problem is is I've only seen examples where the data is put on a form via writing the html using the query results using PHP/AJAX.

    My issue is is I have multiple forms that are dynamically generated given user input so there is no 100% assurance that one person will put in the same input as the next. I've created global objects for all the forms and now I want to populate the data fields on those forms with the results of a database query so when the user interacts with any of the forms the proper data will be there.

    I was wondering if anyone has found a way to solve this problem.

    Thanks!
    ================ EDIT ====================

    Hi Folks,

    I may have narrowed the problem. When I run:

    ajaxRequest.open( "GET", "getData.php?storeNo=" + storeNo, true );
    var response = ajaxRequest.responseText;

    The response variable is empty but when I run Firebug it shows the result of the query is as I expect.

    I tried to print the result to insantiate the value of the text field I want to test using:

    echo "<script language=JavaScript>"
    echo "cityTxt.value = " . $result;
    echo "</script>

    Unfortunately this didn't work either.

    Thanks for any tips!

    PS - Sorry about the duplicate thread name... my bad
    Last edited by canadiancoder; 08-20-2007 at 05:22 PM.

Similar Threads

  1. Posting query results
    By canadiancoder in forum AJAX
    Replies: 4
    Last Post: 08-20-2007, 12:26 PM
  2. Replies: 1
    Last Post: 06-26-2002, 03:29 AM
  3. Using For XML Auto query results
    By Marco in forum Database
    Replies: 0
    Last Post: 06-14-2001, 01:01 AM
  4. Save results of query
    By Paul in forum Database
    Replies: 2
    Last Post: 11-28-2000, 08:35 PM
  5. Query Analyzer - Exporting Results
    By Eric Scantlebury in forum Database
    Replies: 5
    Last Post: 11-13-2000, 11:44 AM

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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center