I'm trying to create a dynamic table using PHP but what I get is in each column of my table the array goes to the end and the next column is staring from the 0 to the end.
I tried to put if conditions and do some tricks to fix it but I couldn't. this is the result I get for below code :
<?php
$query_formsearch = mysqli_query($con,"SELECT * FROM `forms` ");
$query_usr_prvlg = mysqli_query($con,"SELECT * FROM `profile` WHERE `id`='{$_SESSION["usr_id"]}' ");
$usr_access=mysqli_fetch_assoc($query_usr_prvlg);
$count=mysqli_num_rows($query_formsearch);
$i=0;
?>
<form action="" method="POST">
<table>
<tr>
<th></th>
<th></th>
<th></th>
</tr>
<?php while($forms_row = mysqli_fetch_assoc($query_formsearch))
{
$f_num="form_".$forms_row['num'];
?>
<tr>
<td>
<?php if(($usr_access[$f_num]=="1-1") || ($usr_access[$f_num]=="1-0")) ?>
<input class='styled-input_m' type="hidden" id="form-name" name ="form-name" value="<?php echo $forms_row['num']; ?>" />
<input class='styled-input_m' type="submit" id="sbmt-btn" name ="sbmt-btn" value="<?php echo $forms_row['name']; ?>" />
</td>
<td>
<?php if(($usr_access[$f_num]=="1-1") || ($usr_access[$f_num]=="1-0")) ?>
<input class='styled-input_m' type="hidden" id="form-name" name ="form-name" value="<?php echo $forms_row['num']; ?>" />
<input class='styled-input_m' type="submit" id="sbmt-btn" name ="sbmt-btn" value="<?php echo $forms_row['name']; ?>" />
</td>
<td>
<?php if(($usr_access[$f_num]=="1-1") || ($usr_access[$f_num]=="1-0")) ?>
<input class='styled-input_m' type="hidden" id="form-name" name ="form-name" value="<?php echo $forms_row['num']; ?>" />
<input class='styled-input_m' type="submit" id="sbmt-btn" name ="sbmt-btn" value="<?php echo $forms_row['name']; ?>" />
</td>
</tr>
<?php
}
?>
</table>
</form>