Forum: Building VoltDB Clients

Post: Php Client Api: access to table.getColumnName()?

Php Client Api: access to table.getColumnName()?
jeff_i
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?
Hi Jeff, The functionality is
aweisberg
Aug 3, 2010
Hi Jeff,
The functionality is there in the C++ API, but the flags to generate a wrapper aren't. I created an issue and Ed is working on it now. https://issues.voltdb.com/browse/CLIENTAPI-8
-Ariel
Hi Jeff, This is fixed in
edmazur
Aug 3, 2010
Hi Jeff,
This is fixed in clientapi-r67. Using the bottom of the helloworld.php example as a reference:
<?php
// 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"
?>

Ed
Howdy, I couldn't find
jobiwankanobi
Apr 19, 2011
Hi Jeff,
This is fixed in clientapi-r67. Using the bottom of the helloworld.php example as a reference:
<?php
// 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"
?>

Ed


Howdy,
I couldn't find helloworld.php in any of the tarballs.
re: PHP Examples
tcallaghan
Apr 20, 2011
Howdy,
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
-Tim
==
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
Oh sweet. That link will
jobiwankanobi
Apr 20, 2011
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
-Tim
==
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


Oh sweet. That link will help alot.
Thanks.
-jim