Created
November 16, 2015 21:15
-
-
Save leowebguy/e74e790ea4cdd597b37c to your computer and use it in GitHub Desktop.
Insert data into custom table on WordPress (wpdb)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $wpdb; | |
$value = preg_replace("/\r\n|\r|\n/",'-',$value); //replace breaks by "-" | |
$sql = "INSERT INTO `".$wpdb->prefix."contacts` (`CONTENT`) values ('" . $value . "|WEBDEV|" . date("m.d.y h.i A") . "')"; | |
$wpdb->query($sql); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment