mysqli.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef __MYSQLI_H
  2. #define __MYSQLI_H
  3. #include <mysql.h>
  4. #include "mysqli_stmt.h"
  5. #include "mysqli_result.h"
  6. #ifndef nullptr
  7. #define nullptr 0
  8. #endif
  9. class mysqli
  10. {
  11. public:
  12. mysqli();
  13. mysqli(const char *host,const char *username,const char *password,const char *db,int port);
  14. ~mysqli();
  15. void real_connect(const char *host,const char *username,const char *password,const char *db,int port); // http://php.net/manual/en/mysqli.real-connect.php
  16. void prepare(const char *query,unsigned long length,mysqli_stmt &stmt);
  17. void store_result(mysqli_result &result); // http://php.net/manual/en/mysqli.store-result.php
  18. void close(); // http://php.net/manual/en/mysqli.close.php
  19. unsigned int field_count(); // http://php.net/manual/en/mysqli.field-count.php
  20. unsigned int errno(); // http://php.net/manual/en/mysqli.errno.php
  21. const char *error(); // http://php.net/manual/en/mysqli.error.php
  22. bool next_result(); // http://php.net/manual/en/mysqli.next-result.php
  23. bool more_results(); // http://php.net/manual/en/mysqli.more-results.php
  24. void use_result(mysqli_result &result); // http://php.net/manual/en/mysqli.use-result.php
  25. const char *host_info(); // http://php.net/manual/en/mysqli.get-host-info.php
  26. static void throw_null_reference_error();
  27. static void throw_out_of_memory_error();
  28. private:
  29. MYSQL *_mysql;
  30. };
  31. #endif