开发者

What types can Doctrines2's bindValue take?

I have a hard time navigating through Doctrine's Documentation for the DBAL. I would like to know what string values I can put in the $type value of this:

开发者_如何学JAVA
    bindValue($pointername, $variable, $type);

I did not find anything in the documentation that discusses the types.

I'm working with MySQL so I'd like to know the types I can put in the bindValue function that would equate to types like varchar, tinyint, text, datetime, mediumtext, float, etc.


According to http://www.doctrine-project.org/api/dbal/2.0/doctrine/dbal/statement.html#bindValue() the $type parameter can be either a PDO type (see http://au.php.net/manual/en/pdo.constants.php) or a dbal mapping type (see http://www.doctrine-project.org/api/dbal/2.0/doctrine/dbal/types/type.html).

So you could use PDO::PARAM_INT or Doctrine\DBAL\Types\Type::Integer by the looks of things.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜