I am looking to create a MySQLi class(MVC pattern), I already have the following functions: Query, Execute, Results. Below is a PDO version of a Bind statement and was wondering if you could do the following in MySQLi or something similar in MySQLi:

public function bind($param, $value, $type=''){
    case is_int($value):
            //Thinking something like, for integer etc
            $type = mysqli_stmt::bind_param(i);

            $type = PDO::PARAM_INT;
    case is_bool($value):
            $type = PDO::PARAM_BOOL;
            $type = PDO::PARAM_STR;

Then in my MySQLiUser class where I want Bind to be called


$database->bind($type, $userName);

$rows = $database->results();

Any comments, questions or feeback would be greatly appreciated

Recommended Answers

All 3 Replies

Ah, that makes more sense :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.