I will join the topic - I have a SQL query:
SELECT a.tw_Nazwa, c.st_Stan, d.zd_Glowne , d.zd_Zdjecie, a.tw_Id, a.tw_Symbol,e.cht_IdCecha,b.tc_CenaNetto1,b.tc_CenaBrutto1 FROM tw__Towar a LEFT JOIN tw_CechaTw e ON a.tw_Id = e.cht_IdTowar LEFT JOIN tw_Cena b ON a.tw_Id = b.tc_IdTowar LEFT JOIN tw_Stan c ON b.tc_IdTowar=c.st_TowId LEFT JOIN tw_ZdjecieTw d ON d.zd_IdTowar=c.st_TowId WHERE tw_SklepInternet = 1 AND st_MagId = 1
It is assumed that this query will have 261 results and what it needs if it comes with a database program Dbeaver.
Via:
$getResults = sqlsrv_query($conn1, $Query); if( $getResults === false ) { die( print_r( sqlsrv_errors(), true) ); }
and
while ($row = sqlsrv_fetch_array($getResults, SQLSRV_FETCH_ASSOC)) { //blablabla $i++; } print $i //is showing only 12 results
This works, but is not a solution:
for($i=0;$i<=260;$i++){ $row = sqlsrv_fetch_array($getResults, SQLSRV_FETCH_ASSOC) //blablabla $i++; }
where is the mistake and how to get around it.
source share