简体   繁体   中英

mysql check if column is empty with Wordpress

I need to check if the row is empty from mysql and perform an operation, but I can't find where I'm doing wrong. Can anyone help?

my table: mySQL

id | request |
1  |         |
2  | Example | 

Following my code: Php

$checkDescription = $wpdb->get_results("SELECT request FROM wp_request WHERE request=''");

if(!checkDescription ){
echo "Not Null";
}else {
echo "İt's Null"
}

Try

SELECT request FROM wp_request WHERE request is NULL

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM