title: get data from two tables and collect them in array and count rows of one table result
body: <p>I had two tables named fixture_list and OneRecord where fixture_list has 3 columns named Team1, Team2, player whereas OneRecord has columns like Team1, Team2, id, status so here I want to select all the data of fixture_list and put them into array whereas I want to count the number of rows based on this where condition fixture_list.Team1=OneRecord.Team1 and
  fixture_list.Team2=OneRecord.Team2 from OneRecord, actually I am not able to distinguish between selecting the data and putting it into the array and counting the number of rows because I just want to count the rows of one record only. I know things like joins and mysqli_multi_query() can be performed but do not know how...I want to perform this thing in single query please help.</p>
  
  <pre><code>&lt;?php
  
  require_once('connect.php');
  
  $sql = "select * from fixture_list";
  
  if($res = mysqli_query($con,$sql)){
  $result = array();
  
   while($row = mysqli_fetch_array($res)){
  
  array_push($result,
  array('players'=&gt;$row[3],
   'team1_name'=&gt;$row[1],
   'team2_name'=&gt;$row[2]
    ));
    }
  mysqli_free_result($res);
  }
  echo json_encode (array("list"=&gt;$result));
  mysqli_close($con);
    ?&gt;
  </code></pre>