• hello!
    i’m using the following code to retrive titles and ids of posts from my database.

    $ids = $wpdb->get_col("SELECT id FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish'");
    $titles= $wpdb->get_col("SELECT post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish'");

    i want make it to select $ids and $titles for only one category, but i could’t find specific field.
    So can anyone point me where(which table and filed name)is cat id for post?

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘where is cat id in database?’ is closed to new replies.