Support » Plugin: PHP Code Widget » wpdb doesn't work

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Samuel Wood (Otto)

    (@otto42)

    You didn’t declare global $wpdb; first.

    hikmatune

    (@hikmatune)

    Thanks for the reply Samuel but still no luck. Anyway I could debug the process.

    Plugin Author Samuel Wood (Otto)

    (@otto42)

    There’s nothing to debug, I already gave you the correct answer. I know this to be true, because I tested it before I gave you that answer.

    You have to declare the $wpdb variable as a global before you use it in the block of code. Then your code will work.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wpdb doesn't work’ is closed to new replies.