php - sqlsrv only showing most recent row entries -
i have sql command meant display users , actions. happening is showing recent row entries of user, , not entries.
my sql is;
$stmt= " select * actions full outer join users on actions.userid=users.id; "; $query = sqlsrv_query($link,$stmt); $row = sqlsrv_fetch_array($query); i outputting in table as;
while($row = sqlsrv_fetch_array($query,sqlsrv_fetch_assoc)) { echo '<td>' . $row['id'] . '</td>'; ... } would appreciate advice.
--
desired result:
id | user | action | time 1 alpha logged-in 00:00 2 bravo pswd change 00:00 1 alpha logged-out 00:01 --
actual:
id | user | action | time 2 bravo pswd change 00:00 1 alpha logged-out 00:01
it seems this:
$query = sqlsrv_query($link,$stmt); $row = sqlsrv_fetch_array($query); the 2nd line consuming first row array. yes?
this advances pointer in buffer guess (not php person). thus, while() loop starts @ row 2.
Comments
Post a Comment