mysqliAdapter.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. * Adapted from Micah Caldwell's implementation on Flash-db.com boards
  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: mysqliAdapter.php,v 1.2 2005/07/22 10:58:09 pmineault Exp $
  13. */
  14. require_once(AMFPHP_BASE . "shared/adapters/RecordSetAdapter.php");
  15. class mysqliAdapter extends RecordSetAdapter
  16. {
  17. /**
  18. * Constructor method for the adapter. This constructor implements the setting of the
  19. * 3 required properties for the object.
  20. *
  21. * @param resource $d The datasource resource
  22. */
  23. function mysqliAdapter($d)
  24. {
  25. parent::RecordSetAdapter($d);
  26. while($field = mysqli_fetch_field($d))
  27. {
  28. $this->columns[] = $field->name;
  29. }
  30. if(mysqli_num_rows($d) > 0)
  31. {
  32. mysqli_data_seek($d, 0);
  33. while ($line = mysqli_fetch_row($d)) {
  34. $this->rows[] = $line;
  35. }
  36. }
  37. }
  38. }
  39. ?>