Search code examples
phpapiquickbase

Get last record ID from QB PHP wrapper Query


I am using the PHP quickbase wrapper and I need to get a table's most recent record id.

From the tutorials and other materials I have read, I think you need to set your query up like so:

$queries = array(
        array(
            'fid'   => '3',
            'ev'    => 'ex',
            'cri'   => '2')
         );

$results = $quickbase->do_query($queries, '', '', '3');

I know the FID I want is 3, I'm unsure what ev to use, as well as how I would phrase my cri to say the last, or highest count record id.

I have tried basic query's against other data and have gotten 0 returns.

Any help would be greatly appreciated!


Solution

  • I solved my issue.

    When I submit my first record in table A I can grab the rid xml object.

    $results = $quickbase->add_record($fields);
    $rid = $results->rid;