#34497 [NEW]: problem returning data field
| From: | diong at comcast dot net | Date: | Wed, 14 Sep 2005 03:36:30 +0000 |
| Subject: | #34497 [NEW]: problem returning data field | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-85007@lists.php.net to get a copy of this message | ||
From: diong at comcast dot net
Operating system: windows 2000
PHP version: 4.4.0
PHP Bug Type: MSSQL related
Bug description: problem returning data field
Description:
------------
when returning a char type data type from ms sql the field has an added
space at the end of it. This was not a problem in 4.3 and I just had to
copy the php_mssql.dll from the old version to 4.4 and it corrected the
problem.
Reproduce code:
---------------
I am calling a class to get the field:
$SVars = new SessionVars();
$userid = $SVars->GetVar("username");
$query = "SELECT * FROM tSecUser WHERE (SecUser='" . $userid . "')";
$resultsec = $sqlw->sqlquery($query,$cn);
$linesec = $sqlw->fetch_array($resultsec);
echo "<P>*".$linesec["SecUser"]."*";
The echo statement displays *dgering *
it should display *dgering*
here is the class for SessionVars
<?
//Define the SessionVars class
class SessionVars
{
var $seshid;
var $varname;
var $varvalue;
Function SaveVar($VarName,$VarValue)
{
$sqlw = new sqlwrapper();
$cn = $sqlw->dbcn();
Function GetVar($VarName)
{
// connect to database
$sqlw = new sqlwrapper();
$cn = $sqlw->dbcn();
// Retrieves Session Variable from SessVars Table
$sqlquery = "SELECT VarValue FROM SessVars WHERE (SessionID = '" .
$this->seshid . "') AND (VarName = '" . $VarName . "')";
$res = $sqlw->sqlquery($sqlquery, $cn);
$row = $sqlw->fetch_row($res);
return $row[0];
}
}
?>
Expected result:
----------------
The echo statement displays *dgering *
Actual result:
--------------
it should display *dgering*
--
Edit bug report at http://bugs.php.net/?id=34497&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34497&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34497&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34497&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34497&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34497&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34497&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34497&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34497&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34497&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34497&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=34497&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=34497&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34497&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34497&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34497&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34497&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34497&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34497&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34497&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34497&r=mysqlcfg