Php Client Api: access to table.getColumnName()?
Aug 3, 2010
I am using/integrating the php client into my php code. I do not see a way to get the column name for the results of a query - is this possible?
This is fixed in clientapi-r67. Using the bottom of the helloworld.php example as a reference:
// Print the response
$results = $response->results();
$table = $results->get(0);
$columns = $table->columns();
print($columns->get(0)->name()); // prints "HELLO"
print($columns->get(1)->name()); // prints "WORLD"
I couldn't find helloworld.php in any of the tarballs.
Thanks for pointing that out. I'll add Jira tickets to add examples to our C++, C#, and PHP client libraries as well as a link to the examples in our subversion repository.
For now you can grab the PHP examples via this link, https://source.voltdb.com/browse/ClientAPI/php/trunk/examples
EDIT: We've switched to GitHub since this post, so these links won't work. Try: https://github.com/VoltDB/voltdb-client-php/tree/master/examples