Advertisement
Guest User

Untitled

a guest
Mar 30th, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <?php
  2.  
  3. $result_cat = $conexao->prepare("SELECT * FROM colecoes WHERE activo = :activo");
  4. $result_cat->bindValue(':activo', 1, PDO::PARAM_INT);
  5. $result_cat->execute();
  6. $row_cat_l = $result_cat->fetchAll(PDO::FETCH_OBJ);
  7.  
  8. $qtd = count($_REQUEST['categorias_estabelecimentos']);
  9.  
  10. for ( $i = 0; $i < $qtd ; $i++ ) {
  11.  
  12. $cat = $_REQUEST['categorias_estabelecimentos'];
  13.  
  14. }
  15.  
  16. foreach ($row_cat_l as $row_cat) {
  17.  
  18. ?>
  19.  
  20. <label class='checkbox inline'>
  21. <input type="checkbox" <?=(in_array($row_cat->slug, $cat)?'checked="checked"':NULL)?> name="categoria[]" value="<? $row_cat->slug; ?>" />
  22. <?= $row_cat->titulo; ?>
  23. </label>
  24.  
  25.  
  26. <?php
  27.  
  28. }
  29.  
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement