0

Since I am new to php I use to insert data into my database but I am getting error which I do not know how can be it resolved.

Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in E:\xampp\htdocs\airomcc\reseller\paypal.php on line 286

In my code it is line inside if{

}

 $cmq =  mysqli_query($connection,"SELECT DATEDIFF(CURRENT_DATE(),cmstart_date) as 'dif', cmstatus FROM orders WHERE cmstatus = 1; ");

 foreach ($cmq as $cmq_dekhao){
     if($cmq_dekhao['dif'] >= 200)
     {
        mysqli_query($connection,"insert into comission(comission_name,comission_amount,order_id,reseller_id) values ('first time', '50', $cmq_dekhao['orderid'], '$cmq_dekhao['resellerid']');");

        //mysqli_query($connection,"update orders set cmstatus = 0");

     }
     echo $cmq_dekhao['dif'].'<br>';

 }
Thomas Rollet
  • 1,573
  • 4
  • 19
  • 33
noel
  • 7
  • 4
  • Can you edit your question with the complete error text please ? – Thomas Rollet Nov 23 '17 at 09:44
  • I have edited my question and it is not duplicate i am sure, i it is let me know how can i resolve it, Thanks – noel Nov 23 '17 at 09:46
  • @noel it is clearly a duplicate. Please use proper debugging tools to diagnose what is wrong with your code. Please take a look at this https://stackoverflow.com/questions/18050071/php-parse-syntax-errors-and-how-to-solve-them/18092288#18092288. – Tom Udding Nov 23 '17 at 09:47
  • @noel The probleme is here `'$cmq_dekhao['resellerid']'` replace it by `'".$cmq_dekhao['resellerid']."'` – Thomas Rollet Nov 23 '17 at 09:49

0 Answers0