search

Home  >  Q&A  >  body text

How to query data and display it in HTML

I’m new to thinkphp, I’m a novice, and I don’t understand it very well

Table name config

Field id, name

Display value in config.html

<td>{$name}</td>

<td>{$name2}</td>

What cannot be displayed is allarray


学容错学容错2271 days ago1072

reply all(4)I'll reply

  • 胤彬-

    胤彬-2018-10-17 20:49:24

    It is best to paste the code when asking questions

    reply
    0
  • 学容错

    Can't send it out

    学容错 · 2018-10-17 22:12:50
  • Summer

    Summer2018-10-17 14:13:24

    What you render to the page is an array

    reply
    0
  • 学容错

    How to render

    学容错 · 2018-10-17 15:49:06
    学容错

    Can you help me write down the query code?

    学容错 · 2018-10-17 15:50:08
    Summer

    Print $name from the controller to the page to see what kind of array this array is. You are getting the data to the page based on the array; for example, $name=array('name'=>'Zhang San'); then you are To render on the page, use {$name['name']}

    Summer · 2018-10-17 18:22:32
  • Cancelreply