2018-12-28, 10:12 PM
Hello MyBB Community,
i just wanna ask is there a way to write "While Statement" in MyBB Global Temlpates ?!
i got a template that reads some records from MySQL Database such as "uploaded files names, Size, location" and shows it in a table view, but in order to make it read all the records i have to use this code:
but since i can't use php it always gives error.
i tried to use the plugin "[url=http://mybbhacks.zingaburga.com/][/url]PHP and Template Conditionals" but "While Statement" doesn't work in it , it got only "if" statement work..
and if i use "if" statement in here it shows only the first record ..
i hope you can help me guys,
here is a link to preview :
http://dmo4arab.eb2a.com/forum/view.php
thanks in advance.
i just wanna ask is there a way to write "While Statement" in MyBB Global Temlpates ?!
i got a template that reads some records from MySQL Database such as "uploaded files names, Size, location" and shows it in a table view, but in order to make it read all the records i have to use this code:
<tbody>
<?php
while($r = mysqli_fetch_assoc($result)){
?>
<tr>
<th scope="row"><?php echo $r['id'] ?></th>
<td><?php echo $r['name'] ?></td>
<td><?php echo $r['size'] ?></td>
<td><?php echo $r['type'] ?></td>
<td><a href="<?php echo $r['location'] ?>">View</a></td>
<td><a href="#" onclick='deleteItem(<?php echo $r['id'] ?>)'>Delete</a></td>
</tr>
<?php
}
?>
</tbody>
but since i can't use php it always gives error.
i tried to use the plugin "[url=http://mybbhacks.zingaburga.com/][/url]PHP and Template Conditionals" but "While Statement" doesn't work in it , it got only "if" statement work..
and if i use "if" statement in here it shows only the first record ..
i hope you can help me guys,
here is a link to preview :
http://dmo4arab.eb2a.com/forum/view.php
thanks in advance.