Hi
I'm creating a CMS system for a friend of mine, and I'm a bit stuck. Okey, I have created a admin area to edit page content, which is saved in a mysql database. I have created a CKEditor instance for one of the textareas. I'm wondering how I can populate the CKEditor textarea with data from the database. I have tried the code below, but can't get it to work. Any suggestions?
I'm creating a CMS system for a friend of mine, and I'm a bit stuck. Okey, I have created a admin area to edit page content, which is saved in a mysql database. I have created a CKEditor instance for one of the textareas. I'm wondering how I can populate the CKEditor textarea with data from the database. I have tried the code below, but can't get it to work. Any suggestions?
<?php
$ckeditor = new CKEditor();
$ckeditor->basePath = 'includes/wysiwyg/ckeditor/';
$ckeditor->config['filebrowserBrowseUrl'] = 'includes/wysiwyg/ckfinder/ckfinder.html';
$ckeditor->config['filebrowserImageBrowseUrl'] =
'includes/wysiwyg/ckfinder/ckfinder.html?type=Images';
$ckeditor->config['filebrowserFlashBrowseUrl'] = 'includes/wysiwyg/ckfinder/ckfinder.html?type=Flash';
$ckeditor->config['filebrowserUploadUrl'] =
'includes/wysiwyg/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files';
$ckeditor->config['filebrowserImageUploadUrl'] =
'includes/wysiwyg/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images';
$ckeditor->config['filebrowserFlashUploadUrl'] = 'includes/wysiwyg/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash';
$ckeditor->editor('pagebody');
$pagebody = $row[3]; //mysqli_fetch_row($result_from_query);
?>
<script type="text/javascript">
document.editForm.pagebody.value = '<?php echo $pagebody; ?>';
</script>

Re: CKEditor and mysql content
<?php $ckeditor->editor('pagebody'); $pagebody = $row[3]; //mysqli_fetch_row($result_from_query); ?> <script type="text/javascript"> document.editForm.pagebody.value = '<?php echo $pagebody; ?>'; </script><?php $pagebody = $row[3]; //mysqli_fetch_row($result_from_query); $ckeditor->editor('pagebody',$pagebody); ?>