Using the Quickbase PHP SDK for displaying data on the web

  • 0
  • 1
  • Question
  • Updated 7 months ago
  • Answered
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.
Photo of Lochlan Broughton

Lochlan Broughton

  • 224 Points 100 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
We use Javascript - not PHP so I can't help you with your original question, but if you use the API call API_GenResultsTable (link to documentation below) the data will come in html format (see the jht parameter).
Neil

link: https://help.quickbase.com/api-guide/index.html#gen_results_table.html%3FTocPath%3DQuick%2520Base%25...
Photo of Chuck Grigsby

Chuck Grigsby

  • 2,100 Points 2k badge 2x thumb
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?
Photo of GH

GH

  • 616 Points 500 badge 2x thumb
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
(Edited)