Hey guys.. just having a basic problem (yes i am new)... Now, ive cut it down to basics.. but it fails to read the value stored in "fieldname" ... and skips over all the if statements. (ive even set a value of 1 in the fieldname field... and it still skips that step...
Basically, i want the code to die, if the value is 1 or 2. And continue if the value stored in 'fieldname' is 0.
<?php
include("connect.php");
$id=$_POST['id'];
$query="SELECT fieldname FROM tablename WHERE id=$id";
$result=mysql_query($query);
if ( $result == 1 ) {
die ("you are in group 1");
}
if ( $result == 2 ) {
die ("you are in group 2");
}
if ( $result == 0) {
// continue with script
?>