Displaying table data column-wise in a while loop

前端 未结 4 1962
栀梦
栀梦 2021-01-15 15:28

I\'m attempting to retrieve all that data from a database, put it in a table (more than one table if necessary) and display them column-wise in lots of 4 split across multip

4条回答
  •  一整个雨季
    2021-01-15 15:46

    $th1="";
    $td1="";
    $td2="";
    $td3="";
    
    while($row=sqlsrv_fetch_array($result, SQLSRV_FETCH_ASSOC)) { 
    
        $newDate = $row['datenow']->format('d/m/Y');
    
        $th1.="".$newDate."";
        $td1.="".$row['nbsactive']."";
        $td2.="".$row['nbsmanysynced']."";
        $td3.="".$row['nbsthreedays']."";
    
    }
    
    $th1.="";
    $td1.="";
    $td2.="";
    $td3.="";
    
    $result="".$th1.$td1.$td2.$td3."
    ";

提交回复
热议问题