MySQLi Prepared Statements is a lightweight portable PHP class that will allow you to easily run prepared statements.
Whether it’s SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, REPLACE or any other MySQL query you want to run; this script will handle it.
This script supports descriptive error handling, making debugging easier. Using the destruct magic method, automatically after an instance of the class is no longer needed, the MySQLi connection is closed and disconnected, freeing up resources.
Check out the live demo to see the documentation.
Connect to a database
When instantiating the class a data, you simply pass in your MySQL connection details in order to connect to the database. As you can create as many instances as you want, you can connect to as many databases as you want using this class:
$easypreparedstatements = new easyPreparedStatements($dbhost, $dbuser, $dbpassword, $dbname);
Select Example
Get blog posts from the tech category in an array in just one line of code:
$blogposts = $easypreparedstatements->query("SELECT id, title, post FROM posts WHERE `category`= ?", array("tech"));
Insert Example
Insert a new blog post into a MySQL database in one line of code. The script will automatically return the amount of affected rows:
$easypreparedstatements->query("INSERT INTO `posts` (`id`, `title`, `post`, `time`, `category`) VALUES ('?', '?', '?', '?', '?', '?')", array($id, "Title", "Post", $time, "tech"));
[eltd_button size=”huge-full-width” type=”outline” text=”Download & Demo Links” custom_class=”#” icon_pack=”font_awesome” fa_icon=”” link=”” target=”_blank” color=”” hover_color=”” background_color=”” hover_background_color=”” border_color=”” hover_border_color=”” font_size=”” font_weight=”” margin=””]
Demo = MySQLi Easy Prepared Statements
[eltd_button size=”huge” type=”” text=”Full Live Demo” custom_class=”” icon_pack=”font_awesome” fa_icon=”fa-laptop” link=”https://codecanyon.net/item/mysqli-easy-prepared-statements-/8714547″ target=”_blank” color=”” hover_color=”” background_color=”” hover_background_color=”” border_color=”” hover_border_color=”” font_size=”” font_weight=”” margin=””]
Kindly Note: We update new contents like WordPress Themes, Plugins, PHP Scripts everyday. But remember that you should never use this items in a commercial website. All the contents posted here for development & testing purpose only. We’re not responsible for any damage, use at your own RISK! We highly recommend to buy MySQLi Easy Prepared Statements from the The Developer ( NorthernOptic ) website. Thank you.
Download = MySQLi Easy Prepared Statements -[Updated].zip