Forum Discussion

LochlanBroughto's avatar
LochlanBroughto
Qrew Trainee
7 years ago

Using the Quickbase PHP SDK for displaying data on the web

Hi!

I am trying to use the QuickBase PHP SDK to lookup data and display it on a website for clients. I'm having some trouble setting it up. It seems that the data is returned is in an XML format, which I am unfamiliar with. I would just like to know how to get that data to a useable format that can be rendered in HTML. Ideally the data in the field will be all that is returned.

Any help or a push in the right direction would be amazing.

3 Replies

  • Not sure how you're getting the info but a typical jquery call I use is like this

    $.get(dbid, data, callback)

    then for callback it would be this instead
    $.get(dbid, data, function(xml){
    console.dirxml(xml) 
    $("SOME_FIELD_NAME", xml).each(function(){
    $(this).text()
    }
    })

    Ideally your query will only return one record but if it has more than that function will iterate through each record and display that fields value. Make sense?
  • the SDK uses simple XML so you just need to know how to make a php call and work with the response.  let's say you have a do_query call

    let's say field 3 is the Name of a company. Assuming there is only one record.
    $result = $qbc->do_query($query,'','','','3.4.5.6');
    $name = $result->table->records->record->f[0] //Because fid 3 is the first in call above.
    echo $name;

    make sense