下面我尝试使用以下四个参数调用存储过程。但是,我没有收到任何错误,结果也没有产生任何记录。我在填充 1 条记录的数据库中运行查询。有任何想法吗?
<?php
//// GET CONNECTIONS
include('../Connect/con.php');
if(!$conn){
echo 'Connection failed.';
}
if ($conn){
$sql = "{call up_lkpAddressSearch} @State=N'FL', @county=N'BROWARD', @HouseNbr=N'3117', @StreetName=N'COCOPLUM'";
$query_address = sqlsrv_query($conn, $sql);
if( $query_address === false )
{
echo "Error in statement preparation/execution.\n";
die( print_r( sqlsrv_errors(), true));
}
if( $query_address === false ) {
die( print_r( sqlsrv_errors(), true));
}
/* Make the first row of the result set available for reading. */
if( sqlsrv_fetch( $query_address ) === false )
{
echo "Error in retrieving row.\n";
die( print_r( sqlsrv_errors(), true));
}
while( $row = sqlsrv_fetch_array( $query_address, SQLSRV_FETCH_ASSOC) ) {
$id = $row['SA_PROPERTY_ID'];
echo $id;
}
}
// END CONNECTION TEST
sqlsrv_close( $query_address );
?>
我继续尝试制作唱片,我能够呼应出来
$id = sqlsrv_get_field( $query_addressSearch, 0);
echo $id .'<br />';
但是,while 循环不会产生记录。
问候乔什