Delete user using wordpress query (1 post)

  1. Vaib
    Posted 2 years ago #

    Hi i create a custom template and run a query to understand how to execute query in wordpress. I run this query
    global $wpdb;
    echo $sql = $wpdb->prepare("DELETE FROM wpdb->users WHERE ID = 5", $id) ;
    $wpdb->query($sql); ?>

    But it's not working. how can we run wordpress query.

Topic Closed

This topic has been closed to new replies.

About this Topic