dba004.phpt 950 B

12345678910111213141516171819202122232425262728293031323334
  1. --TEST--
  2. DBA Multiple Insert/Fetch Test
  3. --EXTENSIONS--
  4. dba
  5. --SKIPIF--
  6. <?php
  7. require_once(__DIR__ .'/skipif.inc');
  8. die("info $HND handler used");
  9. ?>
  10. --FILE--
  11. <?php
  12. require_once(__DIR__ .'/test.inc');
  13. echo "database handler: $handler\n";
  14. if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
  15. dba_insert("key1", "Content String 1", $db_file);
  16. dba_insert("key2", "Content String 2", $db_file);
  17. dba_insert("key3", "Third Content String", $db_file);
  18. dba_insert("key4", "Another Content String", $db_file);
  19. dba_insert("key5", "The last content string", $db_file);
  20. $a = dba_fetch("key4", $db_file);
  21. $b = dba_fetch("key2", $db_file);
  22. dba_close($db_file);
  23. echo "$a $b";
  24. } else {
  25. echo "Error creating database\n";
  26. }
  27. ?>
  28. --CLEAN--
  29. <?php
  30. require(__DIR__ .'/clean.inc');
  31. ?>
  32. --EXPECTF--
  33. database handler: %s
  34. Another Content String Content String 2