fbsqlAdapter.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. * This version of the frontbase adapter uses fast serialization
  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: fbsqlAdapter.php,v 1.2 2005/07/22 10:58:09 pmineault Exp $
  13. */
  14. require_once(AMFPHP_BASE . "shared/adapters/RecordSetAdapter.php");
  15. class fbsqlAdapter 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 fbsqlAdapter($d) {
  23. parent::RecordSetAdapter($d);
  24. $fieldcount = fbsql_num_fields($d);
  25. for($i = 0; $i < $fieldcount; $i++) {
  26. $this->columns[] = fbsql_field_name($d, $i);
  27. }
  28. if(fbsql_num_rows($d) > 0)
  29. {
  30. fbsql_data_seek($d, 0);
  31. while ($line = fbsql_fetch_row($d)) {
  32. $this->rows[] = $line;
  33. }
  34. }
  35. }
  36. }
  37. ?>