mysql select query within a serialized array

前端 未结 14 1299
忘了有多久
忘了有多久 2020-11-29 07:51

I\'m storing a list of items in a serialized array within a field in my database (I\'m using PHP/MySQL).

I want to have a query that will select all the records that

14条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-29 08:06

    foreach( $result as $value ) {
       $hour = unserialize( $value->meta_value );
       if( $hour['date'] < $data['from'] ) {
         $sum = $sum + $hour['hours'];
       }
     }
    

提交回复
热议问题