insert_data_aftersplit.php 547 B

123456789101112131415161718192021222324252627
  1. <?php
  2. // insert_data_aftersplit.php
  3. require_once 'bootstrap.php';
  4. $newCustomerId = 55;
  5. $shardManager->selectShard($newCustomerId);
  6. $conn->insert("Customers", array(
  7. "CustomerID" => $newCustomerId,
  8. "CompanyName" => "Microsoft",
  9. "FirstName" => "Brian",
  10. "LastName" => "Swan",
  11. ));
  12. $conn->insert("Orders", array(
  13. "CustomerID" => 55,
  14. "OrderID" => 37,
  15. "OrderDate" => date('Y-m-d H:i:s'),
  16. ));
  17. $conn->insert("OrderItems", array(
  18. "CustomerID" => 55,
  19. "OrderID" => 37,
  20. "ProductID" => 387,
  21. "Quantity" => 1,
  22. ));