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

Re: PHP / MySQLi Bind Statement 80 80

This isn't really something I have any experience with, but are you talking about something like this??


Re: PHP / MySQLi Bind Statement 80 80

@Dani I think it's related more to prepared statements in ext/mysqli:


See if this comment helps:

Note: when uploading a blob consider to convert it into a string, otherwise look at:

Re: PHP / MySQLi Bind Statement 80 80

Ah, that makes more sense :)

Be a part of the DaniWeb community

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