1

I want to send data to database, but if result = 1 status=plusone, result = 2 status=plustwo, etc.. It should work like that.. But no, it work like this: result = 2 status=plusone .

What did i missed? Help me..

I've tried this:

$item = '0';

$result = $item + $points;

and:

$result = $points + 0;

Here is rest (part of) code:

if($result = 1){

 $Sql_Query  ="INSERT INTO points SET unique_id = '$id', description = '$Description', points = '$points', status= 'plusone'";
 if(mysqli_query($con,$Sql_Query)) {
 echo 'Succcess!';

 }
}elseif($result = 2){

 $Sql_Query  ="INSERT INTO points SET unique_id = '$id', description = ' $Description', points = '$points', status= 'plustwo'";
  if(mysqli_query($con,$Sql_Query)) {

  echo 'Succcess!';

 }
}
Qirel
  • 23,315
  • 7
  • 41
  • 57
Master
  • 37
  • 9

1 Answers1

2

= and == are different; = is for assignment, and == is to compare statement

Isaac
  • 10,467
  • 12
  • 39
  • 97