Skip to content

Instantly share code, notes, and snippets.

@nmedia82
Last active September 5, 2016 05:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmedia82/cf3de011fb3f19a062985d007efb3166 to your computer and use it in GitHub Desktop.
Save nmedia82/cf3de011fb3f19a062985d007efb3166 to your computer and use it in GitHub Desktop.
Wordpress secure way query into Database
// assumng col is a int value
$wpdb->query( $wpdb->prepare ("INSERT into table_name (col1, col2, col3) VALUES (%d, %s, %s)",
array('$value1','$value2', '$value3')
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment