My CREATE statements were all failing until I set the $nameQuote value to empty string.
Logged In: YES user_id=507145
Yes, I came across this too. Particularly annoying in MS-SQL. My solution was to extend my own db connector with this function:
/** * Quote an identifier name (field, table, etc) * @param string The name * @return string The quoted name */ function NameQuote( $s ) { $q = $this->_resource->nameQuote; if (strlen( $q ) == 1) { return $q . $s . $q; } else { return $q{0} . $s . $q{1}; } }
Where _resource is the ADO connection object and for MS-SQL I defined the nameQuote as '[]'
Logged In: YES user_id=1366626
a better fix for this is: // mysqli defines as is:
var $nameQuote = '`';
// mssql can't use this, so:
var $nameQuote = array('[',']');
// So, when $db->nameQuote is being used to quote column names:
if (!isset($zthis->nameQuote)) $zthis->nameQuote="";
if ( is_array($zthis->nameQuote) ) list($lq, $rq) = $zthis->nameQuote; else $lq = $rq = $zthis->nameQuote;
$fnameq = $lq.$upperfname.$rq;
//as all fields should be delimited to protect reserved word columns.
Logged In: YES
user_id=507145
Yes, I came across this too. Particularly annoying in
MS-SQL. My solution was to extend my own db connector with
this function:
/**
* Quote an identifier name (field, table, etc)
* @param string The name
* @return string The quoted name
*/
function NameQuote( $s ) {
$q = $this->_resource->nameQuote;
if (strlen( $q ) == 1) {
return $q . $s . $q;
} else {
return $q{0} . $s . $q{1};
}
}
Where _resource is the ADO connection object and for MS-SQL
I defined the nameQuote as '[]'
Logged In: YES
user_id=1366626
a better fix for this is:
// mysqli defines as is:
var $nameQuote = '`';
// mssql can't use this, so:
var $nameQuote = array('[',']');
// So, when $db->nameQuote is being used to quote column
names:
if (!isset($zthis->nameQuote)) $zthis->nameQuote="";
if ( is_array($zthis->nameQuote) )
list($lq, $rq) = $zthis->nameQuote;
else
$lq = $rq = $zthis->nameQuote;
$fnameq = $lq.$upperfname.$rq;
//as all fields should be delimited to protect reserved word
columns.