I'm trying to replace the old mssql
connection with pdo
on the MuOnline CMS website. This cms uses sql-server
database of the game in this database has a warehouse table with items column which is varbinary (7680)
, it is different according to the version of the game.
//varbinary lenght
if($mvcore['db_season'] >= '9'){
$cvbins = '7680';
} elseif($mvcore['db_season'] == '1') {
$cvbins = '1200';
} else {
$cvbins = '3840';
};
Тhis is my attempt to retrieve the information from the column.
$mvcorex->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false);
$sth = $mvcorex->prepare("SELECT cast(items AS varbinary(".$cvbins.")) as [items] FROM [warehouse] WHERE [accountid]=:name");
$sth->bindParam(":name", $passnums);
$sth->execute();
$sqll = $sth->errorInfo();
$charItems = $sth->fetch(PDO::FETCH_ASSOC);
The problem here is that if I choose $mvcore['db_season']
to be equal to 9 I get a Fatal error: Invalid sql_display_size in