Warning: mssql_execute() [function.mssql-execute]: message: Implicit conversion

HI,

I’m using PHP +MSSQL for stored procedure on this assignment. So after i been asking around which is on my previous post, i hv successful doing everything on it. So now i had left one only problem on it which bring me this error msg

Warning: mssql_execute() [function.mssql-execute]: message: Implicit conversion from data type xml to varchar is not allowed. Use the CONVERT function to run this query. (severity 16)

My PHP code are
[php]<?php
ini_set(‘display_errors’, ‘On’);
error_reporting(E_ALL);

$timezone = “Asia/Kuala_Lumpur”;
if(function_exists(‘date_default_timezone_set’)) date_default_timezone_set($timezone);
echo date(‘d-m-Y H:i:s’);

echo “
”;

// Server in the this format: <instance name> or
// , when using a non default port number

// Connect to MSSQL
$link = mssql_connect(‘192.168.0.21,1433’, ‘sa’, ******’);

if (!$link) {
die(‘Error connecting db!!’);
}

echo “DB connected”;

echo “
”;

$stmt = mssql_init(‘Trade.spRequestWebTrade’, $link);

mssql_bind($stmt, “@return”, $return, SQLINT4, False, False, 50);
mssql_bind($stmt, “@ReturnMessage”, $ReturnMessage, SQLVARCHAR, TRUE, FALSE, 500);
mssql_bind($stmt, “@OutputXML”, $OutputXML, SQLVARCHAR, TRUE, False, 500);
mssql_bind($stmt, “@ReferralID”, $ReferralID, SQLINT4, False, False, 50);
mssql_bind($stmt, “@LanguageID”, $LanguageID, SQLINT4, False, False, 50);
mssql_bind($stmt, “@TradeType”, $TradeType, SQLINT4, False, False, 50);
mssql_bind($stmt, “@ClientID”, $ClientID, SQLINT4, False, False, 50);
mssql_bind($stmt, “@MarketID”, $MarketID, SQLINT4, False, False, 50);
mssql_bind($stmt, “@MarketQuoteID”, $MarketQuoteID, SQLINT4, False, False, 50);
mssql_bind($stmt, “@CurrencyCode”, $CurrencyCode, SQLINT4, False, False, 50);
mssql_bind($stmt, “@TradeModeID”, $TradeModeID, SQLINT4, False, False, 50);
mssql_bind($stmt, “@Stake”, $Stake, SQLINT4, False, False, 50);
mssql_bind($stmt, “@RequestPrice”, $RequestPrice, SQLINT4, False, False, 50);
mssql_bind($stmt, “@RequestPriceTime”, $RequestPriceTime, SQLINT4, False, False, 50);
mssql_bind($stmt, “@RequestPriceTimeMilliSecond”, $RequestPriceTimeMilliSecond, SQLCHAR, False, False, 50);
mssql_bind($stmt, “@HasCloseOrder”, $HasCloseOrder, SQLINT4, False, False, 50);
mssql_bind($stmt, “@IsGuarantee”, $IsGuarantee, SQLINT4, False, False, 50);
mssql_bind($stmt, “@OrderModeID”, $OrderModeID, SQLINT4, False, False, 50);
mssql_bind($stmt, “@OrderTypeID”, $OrderTypeID, SQLINT4, False, False, 50);
mssql_bind($stmt, “@OrderPriceModeID”, $OrderPriceModeID, SQLINT4, False, False, 50);
mssql_bind($stmt, “@LimitOrderPrice”, $LimitOrderPrice, SQLINT4, False, False, 50);
mssql_bind($stmt, “@StopOrderPrice”, $StopOrderPrice, SQLINT4, False, False, 50);
mssql_bind($stmt, “@TrailingPoint”, $TrailingPoint, SQLINT4, False, False, 50);
mssql_bind($stmt, “@ClosePositionID”, $ClosePositionID, SQLINT4, False, False, 50);

$result = mssql_execute($stmt);

while ($row = mssql_fetch_array($result))
{
$i=0;
while ($i < mssql_num_fields($result))
{
if (!is_null($row[$i]))
{
print “”.mssql_field_name($result, $i)." : ";

          print "".$row[$i]."<br>";
       }
       $i++;
    }
 }

mssql_free_result($result);

?>[/php]

The error msg is prompt on my
mssql_bind($stmt, “@ReturnMessage”, $ReturnMessage, SQLVARCHAR, TRUE, FALSE, 500);

it seems that the data type convertion is wrong on the php side. i hv already tried every string im able to put it. but it still fails me… the sql side data type are XML.

So the error msg prompt me with “Use the CONVERT function to run this query”

where should i put it? i hv no idea on it…

Kindly Please advice

Thanks

Sponsor our Newsletter | Privacy Policy | Terms of Service