DELETE from wp_users where wp_users.ID not in ( SELECT meta_value FROM wp_postmeta WHERE meta_key = ‘_customer_user’ ) AND wp_users.ID not in ( select distinct(post_author) from wp_posts )
Category Archives: MySQL
$query = mysqli_query($mySQLiConnection, “SELECT * FROM table WHERE 1=1”); $array = array(); // look through query while($row = mysqli_fetch_assoc($query)){ // add each row returned into an array $array[] = $row; // OR just echo the data: echo $row[‘username’]; // etc } print_r($array);
$link = mysqli_connect($db_host, $username, $password, $database); if (!$link) { echo “Error: Unable to connect to MySQL.” . PHP_EOL; echo “Debugging errno: ” . mysqli_connect_errno() . PHP_EOL; echo “Debugging error: ” . mysqli_connect_error() . PHP_EOL; exit; } echo “Success: A proper connection to MySQL was made! The my_db database is great.” . PHP_EOL; echo “Host information: […]