How to insert json data in to table?

后端 未结 2 1633
野的像风
野的像风 2021-01-26 00:29

I have written php code to generate json data, Now We have to display this json data into table. My php code is able to generate data but not able able to insert into ta

2条回答
  •  无人及你
    2021-01-26 01:02

    isn't php an option to print the table? If yes you can just echo table rows in the foreach loop and that's it:

    while( $row = mysql_fetch_array( $result ) ) {
      $retVal[] = $row;
    }
    

    becomes something like

    while( $row = mysql_fetch_array( $result ) ) {
      $table_row .= "
         
            $row['cust_name']
            $row['cust_mobile']
            $row['cust_email']
            $row['cust_address']
         ";
    }
    

提交回复
热议问题