Member Avatar for Dainis_1
<?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>

If row_number is not specified, odbc_fetch_row() will try to fetch the next row in the result set. Calls to ... To work around the issue I first do 'select count(*) from blah'. ... so I created it myself to use in in the same way like mysql_fetch_assoc(). ... The cool thing about it is it won't display the data if there is no row for any user.

Be a part of the DaniWeb community

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