Notice: Array to string conversion (SQL Server and PHP) -
Notice: Array to string conversion (SQL Server and PHP) -
i got error when seek fetch array of data.
notice: array string conversion in line 7
however, happens tables. can fetch info other table not these 3 :
user
employeeid (nvarchar) pk uname (nvarchar) udept (nvarchar)transaction_po
poid (int) pk stockid (int) fk employeeid (nvarchar) fk podate (date) povendorname (nvarchar)transaction_so
soid (int) pk stockid (int) fk sodate (date) soquantity (int) socustomer (nvarchar)and code :
require_once 'connection.php'; require_once 'session.php'; $tsql = "select * transaction_po"; $result = sqlsrv_query($conn, $tsql, array(), array( "scrollable" => sqlsrv_cursor_keyset )) or die(sqlsrv_errors()); // line 7 (error) echo '<table id="t01" width="95%" align="center" cellpadding="" cellspacing="0" border="1">'; if (!$result) { die("query show fields table failed"); } while($row = sqlsrv_fetch_array($result)) { echo '<tr> <td><div align="center">' . $row ['stockid'] . '</div></td> </tr>'; } echo "</table>"; sqlsrv_free_stmt($result); sqlsrv_close($conn); ?>
i've tried fetching info other tables , works fine. i've tried never seemed reply why. need help. give thanks in advance.
tried , found reply :
from this
$tsql = "select * transaction_po";
should this
$tsql = "select * [mrs].[dbo].[transaction_po]";
php sql-server arrays database table
Comments
Post a Comment