$wpdb->num_rows doesn't return the correct number
-
Hi all
I’m trying to perform some checks on custom fields before they are saved on a db. So I decided to use an add_filter as it does this between browser and db. Here is my code[Code moderated as per the Forum Rules. Please use the pastebin]
I choose add_filter because the function get_check_key has to verify the previous value $val[‘checks_news’][0] with the new one $checker( if I use add_action, which i tried, they are the same because $val[‘checks_news’][0] retrieves the value just saved so if wanna change that value from 1 to 2 and perform the check it returns 2 == 2). The problem comes when I want to use $wpdb->num_rows which returns always 0 even if the result should be 1. What am i doing wrong? Did I take the right way using add_filter instead of add_action?
Thanks in advance
- The topic ‘$wpdb->num_rows doesn't return the correct number’ is closed to new replies.