I have a self-building CMS system.
So i will FCK editor use in my CMS system.
How is it possible to save de content from the FCK editor in a mysql database?
Example: When i make a text in de FCK editor and a click on "submit" the text must save in de msql database in example de table "content".
Who can tell me, how can is do that?
(Excuse me, my English is very bad)
So i will FCK editor use in my CMS system.
How is it possible to save de content from the FCK editor in a mysql database?
Example: When i make a text in de FCK editor and a click on "submit" the text must save in de msql database in example de table "content".
Who can tell me, how can is do that?
(Excuse me, my English is very bad)
RE: FCK to PHP database
How do you add data to your db now?
I hope not via telnet session or phpMyAdmin..?
Have you already made a php script that collects the data from a form?
If so, just use your php script that is called from the Form action @ submit time, and get the POSTED data withsomething like:
$content = $_POST["content"];
Then, get the data into your db with something like:
$action = mysql_query("INSERT INTO tablename (id, content)
VALUES (NULL, '$content')")
or die("Error when adding data");
Hope this helps...
RE: FCK to PHP database
function documentAdd() //adds to db
{
$Document = unserialize($_SESSION['Document']);
$dbh = dbconnect(); //your connection here
if($this->DocumentOp=='add'){
$DocumentInfo=addslashes($this->DocumentInfo);
$query = "INSERT INTO `documents` (DocumentID, DocumentName, DocumentDate, DocumentInfo, DocumentStatus) ";
$query .= "VALUES ('','".$this->DocumentName."','".$this->DocumentDate."','".$this->DocumentInfo."','0')";
}else if($this->DocumentOp=='update'){
$DocumentInfo=stripslashes($this->DocumentInfo);
## Possibly in the futere code in a document check out system. Rite now I am not worried about it since there
## are so few users and mysql handles locks anyway, you just don't get a nice error message.
$query = "UPDATE `documents` SET `DocumentInfo`='".$this->DocumentInfo."',`DocumentDate`='".$this->DocumentDate."' WHERE `DocumentID`='".$this->DocumentID."'";
}
$query = mysql_query($query) or die("<h3> Cannot perform Requested Function! </h3> ".mysql_error());
mysql_close($dbh);
}
So there is a table called documents that holds all the info.
RE: FCK to PHP database