<?php
    include "head-main.php";
    include "conn.php";
    if(isset($_GET)){ $var = $_GET["cat"]; }
    $data = mysql_query('SELECT kampword FROM data_dict where category=$var');
   $retval = mysql_query( $data, $conn );
     if(! $retval ) {
   die('Could not get data: ' . mysql_error());
   }
   while($row = mysql_fetch_assoc($retval)) {
   echo "World :{$row['kampword']}  <br> ".
     "--------------------------------<br>";
  }
  ?>
i'm new in programming, i can't trace what's wrong with my code, can you help me. i'm trying to print some data on my DB
i always get this error "Could not get data: Query was empty"
 
     
     
    