Can anyone help me and tell me what is wrong with my code? The FCKeditor picks the db stored value right, but it wont write to it and make changes...
You can see it here: http://www.livskallan.nu/test/meditation_admin.php
The code looks like this:
------------------------------------------------------------------------
<?php function input() { $DocumentInfo=addslashes($this->DocumentInfo); $connect = mysql_connect ("localhost", "livskallan", "gfdsa") or die (mysql_error()); $databas = mysql_select_db("livskallan"); $sql = "UPDATE meditation SET DocumentInfo = '$DocumentInfo'"; mysql_query("$sql"); mysql_close($connect); } function show_result() { $connect = mysql_connect ("localhost", "livskallan", "gfdsa") or die (mysql_error()); $databas = mysql_select_db("livskallan"); $sql = "SELECT * FROM meditation"; $result = mysql_query("$sql"); $rad=mysql_fetch_row($result); include("../FCKeditor/fckeditor.php") ; ?>
<html>
<head>
<title>Meditation - Admin</title>
<meta name="robots" content="noindex, nofollow">
<link href="../FCKeditor/sample.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Meditation - Admin</h1>
Hr kan du ndra p meditaionstexten.
<hr>
<form method="post" action="<?=$PHP_SELF?>">
<?php
$oFCKeditor = new FCKeditor('FCKeditor1') ;
$oFCKeditor->BasePath = '/FCKeditor/' ;
$oFCKeditor->Value = "$rad[0]";
$oFCKeditor->Create() ;
?>
<br>
<input type="submit" value="Skicka">
</form>
<?
}
if(!empty($_POST['DocumentInfo']))input();
show_result();
?>
</body>
</html>
-------------------------------------------------------------------------
Please Im not that good in php/mysql, if anyone can help me it would be great
RE: Problem using FCKeditor with MySQL
should be:
$oFCKeditor->Value = $rad[0];
if you need to keep the magic quotoes then you need:
$oFCKeditor->Value = "{$rad[0]}";