Hello,
i downloaded and installed fckeditor into my website yesterday and i am using it to post blogs on to my website. I can successfully create new posts and they display correctly..
I also want to use it to edit existing posts in my database.
I can get fck editor to display my posts that i want to edit but i cannot get it to update my database, it appears to work but when i look at the posts i have edited, it hasn't updated at all.
If anyone has any ideas, i would be very, VERY pleased to hear them!
I am using PHP and i'm using a Mysql database..
my current code looks something like this.
<?php
include("fckeditor.php");
session_start();
//insert my db connection details
include ("vars.inc");
if(isset($_POST['theComment'])){
$query = "UPDATE article SET name='".$_SESSION[logname]."',title='".$_POST['title']."',comments='".$_POST[comment]."'
where artid ='".$_GET['aid']."'";
if(!mysqli_query($cxn,$query)){
echo mysqli_error($cxn);
}else{
header("location:main.php");
exit;
}
}
?>
I then call the original post through by using this:
<?php
$query1 = "select * from article where artid ='".$_GET['aid']."'";
$edit_blog = mysqli_query($cxn, $query1) or die (mysqli_error($cxn));
$blog_result = mysqli_fetch_assoc($edit_blog);
?>
And then my fckeditor is set up as follows:
<?php
$content = $blog_result['comments'];
$sBasePath = $_SERVER['PHP_SELF'] ;
$sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;
$oFCKeditor = new FCKeditor('comment') ;
$oFCKeditor->BasePath = $sBasePath ;
$oFCKeditor->Width = '100%' ;
$oFCKeditor->Height = '300' ;
$oFCKeditor->Value = $content;
$oFCKeditor->Create() ;
?>
Thanks in advance...
i downloaded and installed fckeditor into my website yesterday and i am using it to post blogs on to my website. I can successfully create new posts and they display correctly..
I also want to use it to edit existing posts in my database.
I can get fck editor to display my posts that i want to edit but i cannot get it to update my database, it appears to work but when i look at the posts i have edited, it hasn't updated at all.
If anyone has any ideas, i would be very, VERY pleased to hear them!
I am using PHP and i'm using a Mysql database..
my current code looks something like this.
<?php
include("fckeditor.php");
session_start();
//insert my db connection details
include ("vars.inc");
if(isset($_POST['theComment'])){
$query = "UPDATE article SET name='".$_SESSION[logname]."',title='".$_POST['title']."',comments='".$_POST[comment]."'
where artid ='".$_GET['aid']."'";
if(!mysqli_query($cxn,$query)){
echo mysqli_error($cxn);
}else{
header("location:main.php");
exit;
}
}
?>
I then call the original post through by using this:
<?php
$query1 = "select * from article where artid ='".$_GET['aid']."'";
$edit_blog = mysqli_query($cxn, $query1) or die (mysqli_error($cxn));
$blog_result = mysqli_fetch_assoc($edit_blog);
?>
And then my fckeditor is set up as follows:
<?php
$content = $blog_result['comments'];
$sBasePath = $_SERVER['PHP_SELF'] ;
$sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;
$oFCKeditor = new FCKeditor('comment') ;
$oFCKeditor->BasePath = $sBasePath ;
$oFCKeditor->Width = '100%' ;
$oFCKeditor->Height = '300' ;
$oFCKeditor->Value = $content;
$oFCKeditor->Create() ;
?>
Thanks in advance...

Re: Problems using fckeditor to edit and update existing blogpos
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+