adodbAdapter.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * This Adapter translates the specific Database type links to the data and pulls the data into very
  4. * specific local variables to later be retrieved by the gateway and returned to the client.
  5. *
  6. * Correct typing for MySQL databases contributed by Patrick Gutlich
  7. *
  8. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  9. * @copyright (c) 2003 amfphp.org
  10. * @package flashservices
  11. * @subpackage adapters
  12. * @version $Id: adodbAdapter.php,v 1.2 2005/07/22 10:58:09 pmineault Exp $
  13. */
  14. require_once(AMFPHP_BASE . "shared/adapters/RecordSetAdapter.php");
  15. class adodbAdapter extends RecordSetAdapter {
  16. /**
  17. * Constructor method for the adapter. This constructor implements the setting of the
  18. * 3 required properties for the object.
  19. *
  20. * @param resource $d The datasource resource
  21. */
  22. function adodbAdapter($d) {
  23. parent::RecordSetAdapter($d);
  24. $fieldcount = $d->FieldCount(); // grab the number of fields
  25. for($i = 0; $i < $fieldcount; $i++) { // loop over all of the fields
  26. $fld = $d->FetchField($i);
  27. $this->columns[] = $fld->name;
  28. }
  29. $d->MoveFirst();
  30. $this->rows = $d->GetArray();
  31. }
  32. }
  33. ?>