Skip to content

Instantly share code, notes, and snippets.

@fffergal
Created December 20, 2009 00:05
Show Gist options
  • Save fffergal/260284 to your computer and use it in GitHub Desktop.
Save fffergal/260284 to your computer and use it in GitHub Desktop.
diff -ruN public_html_2009-12-18/useful.inc public_html/useful.inc
--- public_html_2009-12-18/useful.inc 2009-12-04 14:37:13.623578000 +0000
+++ public_html/useful.inc 2009-12-18 02:55:40.794710530 +0000
@@ -19,6 +19,29 @@
}
return self::$mysqli;
}
+
+ static function bind_param($s, &$params) {
+ // Build types
+ $args = array($s, '');
+ foreach ($params as $param) {
+ $args[1] .= $param[0];
+ $args[] = $param[1];
+ }
+
+ return call_user_func_array('mysqli_stmt_bind_param', $args);
+ }
+
+ static function getLastInsertId() {
+ return self::$mysqli->insert_id;
+ }
+
+ static function getState() {
+ return self::$mysqli->sqlstate;
+ }
+
+ static function getError() {
+ return self::$mysqli->error;
+ }
}
class TGHDB {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment