wordpress SQL INSERT Question
-
I am trying to insert in a wp table that has 17 columns. Does anyone have any thoughts on how to do this more efficiently? I’d like to incorporate wpdb->get_col_info(‘name’, offset) into this insert statement so I do not have to type them all out.
Thoughts?
$wpdb->query( $wpdb->prepare(“INSERT INTO $wpdb->mytable (column1, column2, column3, column4, column5, column6, column7, column8, etc etc)
VALUES ( %d, %s, %s, %s, %s, %s, %s, %s, etc etc )”,
$value1, $value1, $value1, $value1, $value1, $value1, $value1, $value1, etc etc) );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘wordpress SQL INSERT Question’ is closed to new replies.