0

I have 4 buttons and when clicking each one it runs different sql query. My code is here:

<?php

if(isset($_POST['submit1'])){
    global $wpdb; 
    $wpdb->update( $wpdb->options, array("option_value" => "000"), array("option_name" => "theme-bg"), array("%s"), array("%s") );
}elseif(isset($_POST['submit2'])){
    global $wpdb; 
    $wpdb->update( $wpdb->options, array("option_value" => "..."), array("option_name" => "widget_son_eklenenler2"), array("%s"), array("%s") );
}elseif(isset($_POST['submit3'])){
   include 'theme2.php';
}elseif(isset($_POST['submit4'])){
      include 'theme3.php';
}
?>

When I clicked second, third or the other buttons, it shows no warning but whenever I click the first button it gives a php warning like this

Thank you for reading it.

Phil
  • 157,677
  • 23
  • 242
  • 245
fatihsolhan
  • 565
  • 5
  • 19
  • Which is line #724 of `acera-options/generate-options.php`? – Phil May 09 '17 at 01:15
  • Hello Phil, here it is. http://prntscr.com/f5oexw – fatihsolhan May 09 '17 at 01:17
  • That's highly unlikely. **On the server running your code**, which is line #724 of `C:\wamp64\www\wp-content\themes\whatever\acera-options\generate-options.php`? – Phil May 09 '17 at 01:18
  • Actually, it was normally line #740, I didnt understand why #721 on that pic. Now it shows #740 http://prntscr.com/f5ofu2 I didnt change anything – fatihsolhan May 09 '17 at 01:21
  • In that case, you need to debug whatever `$value['id']` is. It's probably not a scalar value – Phil May 09 '17 at 01:22
  • More information here ~ http://stackoverflow.com/questions/2732451/php-how-do-i-fix-this-illegal-offset-type-error – Phil May 09 '17 at 01:24
  • I will check it out but I am not good on Php so much, here is my whole code if you can find solution in here http://textuploader.com/d9amf – fatihsolhan May 09 '17 at 01:26

0 Answers0