Related field of a table to another table mysql
<blockquote>
  <p>$image1,$image2,$image3,$image4,$image5. The same with the sku variables</p>
</blockquote>

<pre><code> for ($i = 1; $i &lt;= 5; $i++) {
   $test_image = '$image'.$i;
   $test_sku = '$sku'.$i;
   if(strlen($test_image) !=0 &amp;&amp; strlen($test_sku) !=0){
     array_push($array,$trend,$test_image,$test_sku);
   }
 }
</code></pre>

<p>I want to check these variables in the if statement. The aforementioned code of course doesn't work. Can anyone tell me how can I check all the variables into the statement?</p>
