PHP Class for MySQL and Prepared Statements Reference

For prepared statements in PHP / mySQL check out:

http://mattbango.com/notebook/web-development/prepared-statements-in-php-and-mysqli/

Combine that with:

<?php
class MySqlDriver {
private
$_Link;

public function __construct( <…> ) {
$this->_Link = mysql_connect( <…> );
}

// this will be called automatically at the end of scope
public function __destruct() {
mysql_close( $this->_Link );
}
}

$_gLink = new MySqlDriver( <…> );
// and you don’t need to close the link manually
?>

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • Live
  • MySpace
  • Turn this article into a PDF!
  • Reddit
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz

Leave a Reply

You must be logged in to post a comment.