maybe you'll remember the code. I modified it for using a database. Much easier 🆒 . But now, I have a problem:
I only want to show thing for the right Graphic Calculator (In Dutch: Grafische Rekenmachine, GR for short). I set this in the "$num" variable: 1, 2 or 3. The type of Calculator the program is made for, is set in the database in the column "grtype".
$opdracht="SELECT * FROM [I]Tablename[/I]";
$result=mysql_query($opdracht);
while($row=mysql_fetch_array($result)){
$asdf=$row['grtype'];
settype($asdf,"INT");
if($asdf<$num){
$bericht .="<tr>\n";
$bericht .="<td><a href=\"Javascript: window.open('".$row['locatie']."')\">".$row['naam']."</a></td>\n<td width=\"10\"></td>\n";
$bericht .="<td>".$row['soort']."</td>\n<td width=\"10\"></td>\n";
$bericht .="<td>".$row['grootte']."</td>\n<td width=\"10\"></td>\n";
$bericht .="<td>".$row['levels']."</td>\n<td width=\"10\"></td>\n";
$bericht .="</tr>";
}
}
$bericht .="\n</table></div><br>";
This is not the complete code, but the connection is fine and this is the part where the message (the variable "$bericht") is set, later on it is displayed. It does show everything, also if $num=1, when "Lemmings" shouldn't be shown.
What is wrong with it?
p.s. When I use
$opdracht="SELECT * FROM [I]tablename[/I] WHERE grtype<".$num;
it doesn't show anything.