Skip to Content.
Sympa Menu

freetds - Re: Fwd: Re: FreeBSD / MSSQL / FreeTDS / PHP - data type problem

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: uckun <uckun AT diligence.com>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Re: Fwd: Re: FreeBSD / MSSQL / FreeTDS / PHP - data type problem
  • Date: Fri, 15 Mar 2002 10:21:02 -0700



Ok, I used PHP 4.0.6 with TDS 4.2 and 5.0 against Sybase (I didn't have a
chance to try against MS SQL yet but under 4.2 they should be identical),
and everything worked fine.

Please send in a sample script/all software version information/anything
else remotely interesting.

Freebsd 4.5. Freetds .53. php 4.12, windows NT4.0 ms-sql server 7.0 (sp2 I think).

Here is my generic crash the freetds code in php. I have not been able to get this code yet.

$sql["Null_Bit_Field"]="select top 5 creditqm from tblclients where creditqm is null";
$sql["False_Bit_Field"]="select top 5 creditqm from tblclients where creditqm = 0";
$sql["True_Bit_Field"]="select top 5 creditqm from tblclients where creditqm = 1";
$sql["Varchar_Not_Null"]="select top 5 Name from tblclients";
$sql["Float_Not_Null"]="select top 5 fax from tblclients where fax is not null";
$sql["Float_Is_Null"]="select top 5 fax from tblclients where fax is null";
$sql["Float_is_Zero"]="select top 5 fax from tblclients where fax=0";
$sql["Text_Not_Null"]="select top 5 Notes from tblclients where Notes is not null";
$sql["Text_Is_Null"]="select top 5 Notes from tblclients where Notes is null";
$sql["DateTime_Not_Null"]="select top 5 LastBilled from tblclients where Lastbilled is not null";
$sql["DateTime_IS_Null"]="select top 5 LastBilled from tblclients where Lastbilled is null";
$sql["Money_Not_Null"]="select top 5 CreditLimit from tblclients where creditlimit is not null and creditlimit > 0";
$sql["Money_IS_Null"]="select top 5 CreditLimit from tblclients where creditlimit is null";
$sql["Money_is_Zero"]="select top 5 CreditLimit from tblclients where creditlimit = 0";
$sql["Smallint_Not_Null"]="select top 5 AverageDaysToPay from tblclients where AverageDaysToPay is not null";
$sql["Smallint_IS_Null"]="select top 5 AverageDaysToPay from tblclients where AverageDaysToPay is null";
$sql["Smallint_is_zero"]="select top 5 AverageDaysToPay from tblclients where AverageDaysToPay = 0";
$sql["timespamp_as_datetime"] = "Select cast (upsize_ts as datetime) as TS from tblclients where id=6657";
$sql["timespamp_as_varchar"] = "Select cast (upsize_ts as varchar) as TS from tblclients where id=6657";
$sql["TimeStamp"]="select upsize_ts from tblclients where id=6657";
$sql["All"]="select * from tblclients where id=6657";
$sql["AllNamedFields"]="
Select
ID,
Name,
Fax,
Phone,
Contact1,
Contact2,
Address1,
Address2,
City,
State,
Zip,
CreditNotes,
Notes,
Instructions,
upsize_ts,
Terms

from TblClients where id=6657";



$server= sybase_pconnect('192.168.0.4' , 'web' , 'web');
if (! $server ) {
print "Can not connect to server" ;
exit;
}

if (! sybase_select_db('crims', $server) ) {
print "could not connect to database";
exit;
}

foreach ($sql as $desc => $qry):
print "<hr>testing $desc<br>$qry<p>" ;
$queryID = sybase_query( $qry ,$server);
if ( $queryID === false):
print "Unable to execute statement : ". mssql_get_last_message();
else:
while( $row = sybase_fetch_array($queryID) ):
foreach ($row as $key => $value):
print "$key --> $value ";
endforeach;
echo "<br>\n";
endwhile;
endif;
print "<hr>";
endforeach;
sybase_close($server);




  • Re: Fwd: Re: FreeBSD / MSSQL / FreeTDS / PHP - data type problem, uckun, 03/15/2002

Archive powered by MHonArc 2.6.24.

Top of Page