search

Home  >  Q&A  >  body text

Now only one piece of data is returned. How to return all data that meets the conditions?

Now only one data is returned. How can I get back all the data?

if(!defined('SC')){exit('Access Denied');}

$db = functions::db();

$uid = SC('post/uid');

$wid = $db->query('pinglun','',"user='{ $uid}'");

if($wid){

$array = array(

'ret'=>true,

'id'=>$wid[0]['id'],

'zan'=>$wid[0]['zan']

);

}else{

$array = array(

); 'ret'=>false

);

}

echo json_encode($array);

个人账户个人账户1433 days ago1020

reply all(1)I'll reply

  • 天蓬老师

    天蓬老师2021-01-03 10:11:12

    Multiple pieces of data are also encapsulated into arrays, and can be returned to the front end using js or other formats

    reply
    0
  • Cancelreply