php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34497 problem returning data field
Submitted: 2005-09-14 05:36 UTC Modified: 2005-09-22 01:00 UTC
From: diong at comcast dot net Assigned:
Status: No Feedback Package: MSSQL related
PHP Version: 4.4.0 OS: windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: diong at comcast dot net
New email:
PHP Version: OS:

 

 [2005-09-14 05:36 UTC] diong at comcast dot net
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*

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-14 08:13 UTC] sniper@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.


 [2005-09-22 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Feb 05 05:05:50 2023 UTC