Hi there,In my webpage I am comparing between the correct answer and the user's answer. if both are equal I want the score to increase by one. But the code is not working any hint???

$sql22=mysql_query("select * from player where email='".$_SESSION['touser']."'");
$score1= mysql_fetch_array($sql22);
$score=$score1['score'];
echo $score;
	

$sql10=mysql_query("select * from image");
$score1=mysql_fetch_array($sql10);
$answer=$score1['answer'];
echo $answer;
if (!isset($_SESSION['panswer']))
{
$sql13=mysql_query("select * from image");
$score2=mysql_fetch_array($sql13);
$answer2=$score2['answer2'];
echo $answer2;

	
if(strcasecmp($answer,$answer2) === 0) 
{echo "hiiiiiiiiiiiiih";
echo $n=$score += 1;
  
  
            
$sql12=mysql_query("UPDATE player SET score= $n");}
$_SESSION['panswer']=TRUE;}

Did u checked whether it going inside the if conditions?

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.