PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Operations on tables

This topic lists some samples of operations that can be executed on tables.

Creating a table

Using the following code, a table can be created on Windows Azure production table storage.

Example 910. Creating a table

<?php
$storageClient 
= new Zend_Service_WindowsAzure_Storage_Table(
    
'table.core.windows.net''myaccount''myauthkey'
);
$result $storageClient->createTable('testtable');

echo 
'New table name is: ' $result->Name;

Listing all tables

Using the following code, a list of all tables in Windows Azure production table storage can be queried.

Example 911. Listing all tables

<?php
$storageClient 
= new Zend_Service_WindowsAzure_Storage_Table(
    
'table.core.windows.net''myaccount''myauthkey'
);
$result $storageClient->listTables();
foreach (
$result as $table) {
    echo 
'Table name is: ' $table->Name "\r\n";
}

Zend Framework