Support » Plugins » querying the db from a plugin problem

  • I’m developing a plugin and I am completely unable to insert things to the db. I’ve tried I think everything and nothing!

    There is a main file with the activation function that creates a table in the db (And it works fine)

    Then in the plugin page there is a form that I use to add rows to the db. But it doesn’t seem to work…
    Here is the Insert code:

    $insert = "INSERT INTO " . $table_name .
    " (name, selector, bg, color, font, apply) " .
    "VALUES ('$name','$selector'.'$bg','$color','$font','$apply')";
    
    $results = $wpdb->query($insert);

    The $table_name is perfectly fine. There is also the field id at the beginning, but it’s set to auto_increment so there is no need to put it there.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘querying the db from a plugin problem’ is closed to new replies.