Created
November 1, 2015 02:40
-
-
Save karellism/e33b8a4843c15a5192dd to your computer and use it in GitHub Desktop.
Saving the data to the database for simple CMS - php file
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
public function write($p) { | |
if ( $p['title'] ) | |
$title = mysql_real_escape_string($p['title']); | |
if ( $p['bodytext']) | |
$bodytext = mysql_real_escape_string($p['bodytext']); | |
if ( $title && $bodytext ) { | |
$created = time(); | |
$sql = "INSERT INTO testDB VALUES('$title','$bodytext','$created')"; | |
return mysql_query($sql); | |
} else { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment