Dainis_1 0 Newbie Poster
<?php 
error_reporting(0);
require  'conn.php';
global $conn;
$tablename = $_SESSION['user_id']."_LIETOTAJU_ATIBLDES";


$sql = "CREATE TABLE ".$tablename." (
  id INT NOT NULL AUTO_INCREMENT,
  ATBILDE varchar(255),
  PATIES varchar(255),
  PRIMARY KEY (id)
  )";

  if (mysqli_query($conn, $sql)) {

  } else {  
  }

$val = $_GET['QUESTONS'];

    mysqli_set_charset($conn,"utf8");    
     $sql = "SELECT * FROM Jautajumi_Prof where TEMAS_NOSAUKUMS = ? ";
     $stmt = mysqli_stmt_init($conn); 

     if(!mysqli_stmt_prepare($stmt, $sql)){
      header ('location: test.php?error');
      exit();

      }else{
        mysqli_stmt_bind_param($stmt, "s", $val);
        mysqli_stmt_execute($stmt);
        $result = mysqli_stmt_get_result($stmt);

      }  
     $sum = 0;
     $one = 1;
     $sum = $sum + $one;
      while ($row = mysqli_fetch_assoc($result)){          

        echo "            
          <form class='test_place' action='answer.inc.php?QUESTONS=".$_GET['QUESTONS']."' method='post'>
          <h4>". $sum = $sum + $one .". ".$row["JAUTAJUMS"]."</h4>
            <input type='checkbox' class='testplace' name='check_list[]' value='".$row["ATBILDE_A"]."' >     
            <label>".$row["ATBILDE_A"]."</label>
            <input type='checkbox' name='check_list[]' value='".$row["ATBILDE_B"]."'>            
            <label>".$row["ATBILDE_B"]."</label>
            <input type='checkbox' name='check_list[]' value='".$row["ATBILDE_C"]."'>            
            <label>".$row["ATBILDE_C"]."</label>
            <input type='checkbox' name='check_list[]' value='".$row["ATBILDE_D"]."'>           
            <label>".$row["ATBILDE_D"]."</label>          
          <form>
          ";    

      }     



?>

 <div class='iesniegt'>
     <form method='post' action='answer.inc.php'>
         <input name='iesniegt' type='submit' id='iesniegt' value='Iesniegt'>
     </form>
 </div>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.