Re: PHP and MSSQL Problem

From: Date: Sat, 28 Sep 2002 13:33:41 +0000
Subject: Re: PHP and MSSQL Problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-117939@lists.php.net to get a copy of this message
Hello, ...just wondering... Are you sure VARCHAR in MS SQL can handle 5000? Should be 255 only? (I'm not really familiar with MS SQL but you can count the number of characters returned by php...) - E "Christopher J. Crane" <ccrane@inxdesign.com> wrote in message news:20020928131633.31875.qmail@pb1.pair.com... > I wrote a simple script to return data from a query. The database is MS SQL > and the field I am looking to return is a VARCHAR(5000). Everything seems to > work except the data returned is not the whole field it is shortened. It > only returns a portion of the field. > > Here is the field: > 99 Services, Inc. is a full service IT systems integrator and general > contractor specializing in cradle to grave technology planning with strong > emphasis on LAN/WAN design (routing and switching) and deployment of high > speed, fully redundant, high availability networks. 99 Services also > provides Internet/Intranet/Website/email systems design. The company > services small to medium sized businesses as well as home offices. > > Here is what is returned by the PHP: > 99 Services, Inc. is a full service IT systems integrator and general > contractor specializing in cradle to grave technology planning with strong > emphasis on LAN/WAN design (routing and switching) and deployment of high > speed, fully redundant, high availab > > > Here is the script: > <?PHP > /* CTC Profile about Company */ > /* ========================= */ > $HostName = "DAS54-DAL-SBC"; > $UserName = "*******"; //changed for security > $Password = "********"; //changed for security > $DBName = "DirectoryDB"; > > MSSQL_CONNECT($HostName,$UserName,$Password); > mssql_select_db($DBName) or DIE("Table unavailable"); > > $ProfileResults = MSSQL_QUERY("SELECT * FROM CompanyProfile WHERE > CompanyID = '$ID'"); > $RowCount = MSSQL_NUM_ROWS($ProfileResults); > > if($RowCount != 0) { > for ($i = 0; $Field2 = MSSQL_FETCH_ARRAY($ProfileResults); ++$i) { > $Profile = $Field2["Profile"]; > echo $Field2["CompanyID"] . "<br>" . > $Field2["Profile"] . > "<br><br>To read more information about this "; > echo "company, visit their website\n"; > } > } > else { print "This company, $sym is not listed in the CTC Directory."; } > > MSSQL_CLOSE(); > ?> > >

« previous php.general (#117939) next »