I am trying to get favorite post ids from my table with get_col, but the results return ids as string instead of int. How can i get them directly as int ?
$sql = "SELECT post_id FROM {$table} $where
GROUP BY post_id
ORDER BY post_type
LIMIT $offset, $count";
$wpdb->get_col( $sql );
Thank you for the comments.
To answer my own question; there is no way to return the result as int, since this is the default behaviour of wp.
So you can either use wp’s native function: absint($result[$item]), or $result_int = array_map(‘intval’,$result);
I went with the latter.