php - stored procedure returns different columns -
we've been running stored procedures on ms sql database though odbc using php. whenever run sp returns same 2 column names, regardless of sp run. if results set has more 2 columns, first 2 returned.
it's it's got stuck on results previous query. when run on own, in php file containing sp, every sp returns 2 columns same titles before, regardless of number of columns or column titles should returned. contents of columns matches first 2 columns expect.
example: looking contact in address book returns following column names of sp executed morning, contained 2 columns in result set.
01234 567890 | john
01234 567890 | alice
when should return
01234 567890 | john | smith | m
01234 567890 | alice | chalk | f
with column names 'number' 'fname' 'sname' , 'gender'.
code is:
$query = "{call dbo.storedproc('functionname', $search, 'id')}"; $resultset = odbc_prepare($connection, $query); odbc_execute($resultset, array()); odbc_result_all($resultset);
Comments
Post a Comment