Asked 7 years ago
24 Jan 2017
Views 3641
pratik

pratik posted

How to display data in ckeditor from mysql in PHP

How to display data in ckeditor from mysql in PHP
Rasi

Rasi
answered Nov 30 '-1 00:00

download CKEditor sdk and embed ckeditor.js to head of web page
or use ckeditor.js direct from cdn

<head>
<script src="http://cdn.ckeditor.com/4.6.2/standard-all/ckeditor.js"></script>
</head>


here is your answer .

<?php 
//do the mysql connection 
//fetch the needed data suppose we have data one  $text_content;
//and simply print in textarea 
?>
<textarea cols="80" id="editor1" name="editor1" rows="10" > <?php echo $text_content; ?></textarea>

	<script>
		CKEDITOR.replace( 'editor1', {
			uiColor: '#CCEAEE'
		} );
	</script>
Post Answer