Hi !
I'm so confused right now. I've been trying to figure this out for two days...no luck
I insert a table and a picture with editor and save into MySQL database. When I return to edit the page I've just saved it may look like this in the source mode.
<table cellspacing="1" cellpadding="1" width="200" border="1">
<tbody>
<tr>
<td></td>
</tr>
<tr>
<td></td>
<></</>
</tr>
</tbody>
</table
The last > is missing and there are weird < chars or there can an extra </tb in the beginning of the table. This happends when I first insert a picture and then a table. You can also see the extra characters when you're not in the source mode.
If I insert a table first and then a picture the last part of the url of the picture may also be missing.
<img height="475" src="/pages/admin/UploadPics/test.jpg" width="310" b
I really cant say what causes this. Is it the editor or my sql statements. So I'll post those too:
This gets the data from database:
<?php $SQLfetch = "SELECT * FROM tblPage1"; $result_fetch = mysql_query($SQLfetch) or die ("<p>Error</p>"); $row = mysql_fetch_array($result_fetch); if(mysql_num_rows($result_fetch)) { $text = $row["page_text"]; $text = preg_replace("/\r\n|\n\r|\n|\r/", "<br>\n", $text); ?>
<form action="save_page.php" name="content" method="post">
<?php $oFCKeditor = new FCKeditor ; $oFCKeditor->BasePath = $editorPath; $oFCKeditor->ToolbarSet = 'Basic'; $oFCKeditor->Value = $text; $oFCKeditor->CreateFCKeditor( 'Editor1', '100%',500 ) ; ?>
</form>
This saves the data:
<?php $textNew = $_POST['Editor1']; $textNew = str_replace("'","'",stripslashes($textNew)); $SQLupdate = "UPDATE tblPage1 SET text = '".$textNew."' WHERE PageId = 1 "; $result_update = mysql_query($SQLupdate); ?>
I hope someone can help me. This is really important for me.
Thank you.
jell-o