php - Why if($tech[0] == "HTML") is not working in the following code and the echo output is not generated -
in following code, if condition not working?? when echoing code $tech[0] giving output html, when doing in mentioned way if condition not working. may know reason when giving code <?php if(1) { echo "hey"; } ?>
output generated hey.
code follows:
<?php include('connection.php'); //$row=array(); if(isset($_get['id']) && !empty($_get['id']) && $_get['action']== 'edit'){ $fetch ="select * students id=".$_get['id']; $selectrow =mysqli_query($conn,$fetch); $row =mysqli_fetch_array($selectrow); $tech = explode(',',$row['technologies_known']) ; if($tech[0] == "html") { echo 'hey'; } } ?>
after row please check if getting in arrays.
echo '<pre>'; print_r($row);
also after explode please check again printing array
echo '<pre>'; print_r($tech);
Comments
Post a Comment