Quantcast
Channel: Topic Tag: MySQL | WordPress.org
Viewing all articles
Browse latest Browse all 5534

mihai2k on "wp_posts custom mysql column name"

$
0
0

Hi!
I don't to use wp_postsmeta but wp_posts. I have inserted a custom column name in MySQL table wp_posts , named "test_col".
I want to be able to use wp_insert_post to populate that custom column in mysql, like this :

// Create post object
$my_post = array(
  'post_title'    => 'My post',
  'post_content'  => 'This is my post.',
  'post_status'   => 'publish',
  'post_author'   => 1,
  'test_col' => 'whatever'
);

// Insert the post into the database

wp_insert_post( $my_post );

and also .. how can i gat that value out when get_posts()
Thank you !


Viewing all articles
Browse latest Browse all 5534

Latest Images

Trending Articles


Practice Sheet of Pronoun References for HSC Students


Download: Alice Chuma – Okondewa


Neem Baba Extra Questions Answer Class 6 English Poorvi


CalCen


Muloraki Au


Mahakal Attitude Status


Love (2015).H264.Italian.English.Ac3.5.1.multisub.iCV-MIRCrew Seed (62)/Leech...


MUSIC STATION – 2017.09.01


Waves Complete v2019.02.14 Incl Emulator-R2R


Students hit streets to save Agriculture College land in city



Latest Images