$filter = " PartitionKey eq 'myCustomer' "; $result = $tableRestProxy->queryEntities("customer", $filter);
<?php require_once "WindowsAzure/WindowsAzure.php"; require_once 'PHPUnit\autoload.php'; use WindowsAzure\Common\ServicesBuilder; use WindowsAzure\Common\ServiceException; // Create Connection String $connectionString = "DefaultEndpointsProtocol=http;AccountName=[yourAccount];AccountKey=[yourKey]"; // Create table REST proxy. $tableRestProxy = ServicesBuilder::getInstance()->createTableService($connectionString); $filter = " PartitionKey eq 'myCustomer' "; try { $result = $tableRestProxy->queryEntities("customer", $filter); } catch(ServiceException $e){ $code = $e->getCode(); $error_message = $e->getMessage(); } $entities = $result->getEntities(); echo " <table width=\"800\" border=\"1\"> <tr> <th width=\"91\"> <div align=\"center\">PartitionKey </div></th> <th width=\"91\"> <div align=\"center\">RowKey </div></th> <th width=\"91\"> <div align=\"center\">CustomerID </div></th> <th width=\"98\"> <div align=\"center\">Name </div></th> <th width=\"198\"> <div align=\"center\">Email </div></th> <th width=\"97\"> <div align=\"center\">CountryCode </div></th> <th width=\"59\"> <div align=\"center\">Budget </div></th> <th width=\"71\"> <div align=\"center\">Used </div></th> </tr> "; foreach($entities as $entity){ echo " <tr> <td><div align=\"center\">". $entity->getPartitionKey()."</div></td> <td><div align=\"center\">".$entity->getRowKey()."</div></td> <td><div align=\"center\">".$entity->getProperty("CustomerID")->getValue()."</div></td> <td>".$entity->getProperty("Name")->getValue()."</td> <td>".$entity->getProperty("Email")->getValue()."</td> <td><div align=\"center\">".$entity->getProperty("CountryCode")->getValue()."</div></td> <td align=\"right\">".$entity->getProperty("Budget")->getValue()."</td> <td align=\"right\">".$entity->getProperty("Used")->getValue()."</td> </tr> "; } echo "</table>"; ?>
<?php require_once "WindowsAzure/WindowsAzure.php"; require_once 'PHPUnit\autoload.php'; use WindowsAzure\Common\ServicesBuilder; use WindowsAzure\Common\ServiceException; // Create Connection String $connectionString = "DefaultEndpointsProtocol=http;AccountName=[yourAccount];AccountKey=[yourKey]"; // Create table REST proxy. $tableRestProxy = ServicesBuilder::getInstance()->createTableService($connectionString); $filter = " PartitionKey eq 'myCustomer' "; try { $result = $tableRestProxy->queryEntities("customer", $filter); } catch(ServiceException $e){ $code = $e->getCode(); $error_message = $e->getMessage(); } $entities = $result->getEntities(); echo " <table width=\"800\" border=\"1\"> <tr> <th width=\"91\"> <div align=\"center\">PartitionKey </div></th> <th width=\"91\"> <div align=\"center\">RowKey </div></th> <th width=\"91\"> <div align=\"center\">CustomerID </div></th> <th width=\"98\"> <div align=\"center\">Name </div></th> <th width=\"198\"> <div align=\"center\">Email </div></th> <th width=\"97\"> <div align=\"center\">CountryCode </div></th> <th width=\"59\"> <div align=\"center\">Budget </div></th> <th width=\"71\"> <div align=\"center\">Used </div></th> <th width=\"71\"> <div align=\"center\">Detail </div></th> </tr> "; foreach($entities as $entity){ echo " <tr> <td><div align=\"center\">". $entity->getPartitionKey()."</div></td> <td><div align=\"center\">".$entity->getRowKey()."</div></td> <td><div align=\"center\">".$entity->getProperty("CustomerID")->getValue()."</div></td> <td>".$entity->getProperty("Name")->getValue()."</td> <td>".$entity->getProperty("Email")->getValue()."</td> <td><div align=\"center\">".$entity->getProperty("CountryCode")->getValue()."</div></td> <td align=\"right\">".$entity->getProperty("Budget")->getValue()."</td> <td align=\"right\">".$entity->getProperty("Used")->getValue()."</td> <td align=\"center\"><a href='phpAzureTable2.php?CusID=".$entity->getProperty("CustomerID")->getValue()."'>View</a></td> </tr> "; } echo "</table>"; ?>
<?php require_once "WindowsAzure/WindowsAzure.php"; require_once 'PHPUnit\autoload.php'; use WindowsAzure\Common\ServicesBuilder; use WindowsAzure\Common\ServiceException; // Create Connection String $connectionString = "DefaultEndpointsProtocol=http;AccountName=[yourAccount];AccountKey=[yourKey]"; // Create table REST proxy. $tableRestProxy = ServicesBuilder::getInstance()->createTableService($connectionString); try { $result = $tableRestProxy->getEntity("customer", "myCustomer", $_GET["CusID"]); } catch(ServiceException $e){ $code = $e->getCode(); $error_message = $e->getMessage(); } $entity = $result->getEntity(); ?> <table width="329" border="1"> <tr> <td width="118">PartitionKey</td> <td width="195"><?php echo $entity->getPartitionKey()?></td> </tr> <tr> <td>RowKey</td> <td><?php echo $entity->getRowKey();?></td> </tr> <tr> <td>CustomerID</td> <td><?php echo $entity->getProperty("CustomerID")->getValue();?></td> </tr> <tr> <td>Name</td> <td><?php echo $entity->getProperty("Name")->getValue();?></td> </tr> <tr> <td>Email</td> <td><?php echo $entity->getProperty("Email")->getValue();?></td> </tr> <tr> <td>CountryCode</td> <td><?php echo $entity->getProperty("CountryCode")->getValue();?></td> </tr> <tr> <td>Budget</td> <td><?php echo $entity->getProperty("Budget")->getValue();?></td> </tr> <tr> <td>Used</td> <td><?php echo $entity->getProperty("Used")->getValue();?></td> </tr> </table>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท