I
I
iddddy2019-12-11 19:52:22
PHP
iddddy, 2019-12-11 19:52:22

How to output the data in the first array from the second?

first array:

$sql = "SELECT * FROM video WHERE network_id = ".intval($network['NID'])." AND active ='1' ORDER BY addtime DESC LIMIT ".$config['networkvideo_per_page'];
  $rs=$conn->execute($sql);
  $videos = $rs->getrows();

second:
$active     = ( $config['approve'] == '1' ) ? " AND v.active = '1'" : NULL;
$sql        = "SELECT *
               FROM video WHERE VID = " .$vid.  .$active. " LIMIT 1";
$rs         = $conn->execute($sql);
$video              = $rs->getrows();
$video              = $video['0'];
  $formats = explode(',', $video['formats']);
  foreach ($formats as $key => $value) {
     unset($f);
     $f = explode('.', $value);
     $vf[$key]['height'] = $f[0];
     $vf[$key]['label']  = $f[1]; 
     $vf[$key]['format'] = $f[2];
     $vf[$key]['file']   = $video['VID']."_".$vf[$key]['label'].".".$vf[$key]['format']; 
  }
  $video['files'] = $vf;

the first array displays a list of videos, the second array contains the name of the video to be inserted into the first array. $vid is a shared variable.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question