I have looked all over this forum and I haven't found anything helpful. I have initialized the instance but I need to know how to populate my SQL query inside of the text box. Anybody have any knowledge?
<title>Sample - CKEditor</title> <script type="text/javascript" src="../ckeditor/ckeditor.js"></script> </head> <body> <form method="post"> <p> <textarea name="editor1"> <?php $PageName = $_GET['PageName']; // Get data from the database $query = mysql_query("SELECT Content FROM PageContent WHERE PageName='".$_REQUEST['PageName']."'"); $data = mysql_fetch_array($query); // Configure and output editor ?> </textarea> <script type="text/javascript"> CKEDITOR.replace( 'editor1' ); </script> </p> <p> <input type="hidden" name="PageName" value=" </p> </form> </body> </html> <input type="hidden" name="submit_form" value="1"> <br> <input type="submit" value="Save Page"> </form>
Re: CKeditor MySQL issues
Hi,
you're almost there...
get your data from mysql first then echo the results inside the textarea.
<?php
$result = mysql_query("SELECT * FROM tbl")
while ($row = mysql_fetch_array($result))
$answer = $row['row name']
?>
<form id..>
<textarea id="ckeditor"><?php echo $answer; ?></textarea>
<input type="submit" value="Save Changes"/>
</form
and the rest you've already got
Hope it helps