mysql - PHP conditions in ajax -
the code below part of ajax script. else working except below.
i have no thought why happening :
$q_e = mysqli_query($sqllink,"select * events_parent id='$id_parent'"); $r_e = mysqli_fetch_array($q_e); if($id_cure == $r_e['id_cure']){ $same = 1; }else{ $same = 2; } if($same == 1){ //condition # cure same mysqli_query($sqllink,"update events_parent ... ") }elseif($same == 2){ // status b # cure changed mysqli_query($sqllink,"update events_parent ...") } no matter value of $same is, code still goes status when should go status b. if stop script :
if($id_cure == $r_e['id_cure']){ $same = 1; }else{ $same = 2; } echo "same : $same"; exit(); it outputs "same : 2", mysql update correctly set in status b update set in status a.
what doing wrong ? tried using "===" instead of "==" not result... has thought ?
php mysql if-statement
No comments:
Post a Comment