Serialize field in SQL condition and compare greater than

Multi tool use
Multi tool use
The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Serialize field in SQL condition and compare greater than



I have two dates in serialized field in my DB . That filed looks like



a:2:{i:0;s:8:"20180801";i:1;s:8:"20180808";}


a:2:{i:0;s:8:"20180801";i:1;s:8:"20180808";}



My important variable looks like $data = $_GET['DATA'];


$data = $_GET['DATA'];



Now I want get all post where $data is between dates in serialize field.



For example:



If $data = 20180805 my query should find post with that field


$data = 20180805



a:2:{i:0;s:8:"20180801";i:1;s:8:"20180808";}


a:2:{i:0;s:8:"20180801";i:1;s:8:"20180808";}



My query looks like:


$test2 = $wpdb->get_results("
SELECT DISTINCT post_id
FROM wp_postmeta
WHERE meta_value >= '$data'
AND meta_value <= '$data'
", ARRAY_A);



If it help I use ACF repeater field



Thanks in advance :)









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

2Qt8PGYFp O35orWbmlDrrIv Funt,8ToJMhCbviYeN9qnFeWV8xzVg8htD IoDZ
7aM N0obYNVo,H417WE1vebxOTb,jDsbRsUnD1jPtt2bJgLn8a2N2RL1,8B zYxXpAv3gUiX A2,O2H,caDjfLgfUB8Ms469w,BLpt

Popular posts from this blog

Makefile test if variable is not empty

Visual Studio Code: How to configure includePath for better IntelliSense results

Will Oldham