Warning: count(): Parameter must be an array or an object that implements Countable in

Hello
Warning: count(): Parameter must be an array or an object that implements Countable in

How do I fix this error?
[secilen_hdd_id] => 5
[secilen_hdd_sayisi] => 2

   if(!empty($_SESSION['secilen_hdd_id']) OR !empty($_SESSION['secilen_hdd_sayisi'])){
      for($i=0; $i<count($_SESSION['secilen_hdd_id']); $i++) {
      $hdd_id[] = $_SESSION['secilen_hdd_id'][$i];
      $hdd_amount[] = $_SESSION['secilen_hdd_sayisi'][$i];
      }
      $values = array();
      for($i=0; $i<count($hdd_id); $i++) {
      $values[]="({$id}, {$hdd_id[$i]}, {$hdd_amount[$i]})";
      }         
      $hdd_id_adet=$mysqli->query("INSERT INTO hdd_adetleri (`id`, `hdd_id`, `hdd_adet`) VALUES " . implode(", ", $values));
      if (!$hdd_id_adet)
      {
      die(mysql_error());
      }
      } 

Thank you from now

Give count() a variable that is an array or an object that implements Countable, maybe?

I could not understand, Could you write more descriptive

Doesn’t appear to have anything in it to count.

Yes, There’s only one number
I understand, I have to re-edit

Thank you so much

Sponsor our Newsletter | Privacy Policy | Terms of Service