Skip to content

Instantly share code, notes, and snippets.

@atleastimtrying
Created July 23, 2012 14:13
Show Gist options
  • Save atleastimtrying/3163821 to your computer and use it in GitHub Desktop.
Save atleastimtrying/3163821 to your computer and use it in GitHub Desktop.
email_log
function store_in_msg_table($message){
$message = mysql_real_escape_string($message);
openconn();
$sql = '';
if(!mysql_num_rows( mysql_query("SHOW TABLES LIKE 'email_store'"))){
$sql = "CREATE TABLE 'email_store' ('id' INT NOT NULL AUTO_INCREMENT PRIMARY KEY , 'message' TEXT NOT NULL , 'date_sent' TIMESTAMP NOT NULL);";
mysql_query($sql) or die(mysql_error());
}
$sql = 'INSERT INTO email_store (message) values ("'.$message.'");';
mysql_query($sql) or die(mysql_error());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment