Created
July 23, 2012 14:13
-
-
Save atleastimtrying/3163821 to your computer and use it in GitHub Desktop.
email_log
This file contains hidden or 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
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