PHP Classes

File: php/menu.php

Recommend this page to a friend!
  Classes of Ann   Purp Project   php/menu.php   Download  
File: php/menu.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Purp Project
Application to manage photo albums
Author: By
Last change: Update of php/menu.php
Date: 1 year ago
Size: 1,328 bytes
 

Contents

Class file image Download
<?php

session_start
();

function
getMenu(){
    include
'includes/connect-db.php';

   
$query = 'SELECT * FROM `cathegory`';
   
$result = mysqli_query($connect, $query) or die("?????? " .mysqli_error($connect));

    while(
$rs = mysqli_fetch_array($result)){
        echo
"<div class = \"cath\">
        <input type=\"checkbox\" id=\""
.$rs['id']."\" name=\"box\" value=\"".$rs['name']."\">
         <label for=\""
.$rs['id']."\">
        <span></span>"
.$rs['name']."
       
        <ins><i>"
.$rs['name']."</i></ins>
      </label></div>"
;

    }


}

function
getCats(){
    include
'includes/connect-db.php';
   
$query = 'SELECT * FROM `cathegory`';
   
$result = mysqli_query($connect, $query) or die("?????? " .mysqli_error($connect));

    while(
$rs = mysqli_fetch_array($result)){
        echo
"<option>".$rs['name']."</option>";
    }

   
}

//require_once 'includes/connect-db.php';
// $caths = [];
// $caths = $_POST['caths'];
// print_r($caths);

// if($caths){
// foreach($caths as $cath){
// $query = "SELECT * FROM `cathegory` WHERE name = '$cath'";
// $result = mysqli_query($connect, $query) or die("?????? " .mysqli_error($connect));
// $rs = mysqli_fetch_array($result);
// }
// print_r($rs);
// }
?>