I'm using FCKeditor for over a year now to put small guides online.
I've never had any errors untill an error occurered while updating the database a few days ago. Adding new stuff (insert) and deleting stuff (delete) still works perfectly.
The error I get is the following:
Error2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'width:181.5pt; height:147pt'>
'width:181.5pt; height:147pt'> are some settings from a picture I've included into the guide. But as I've allready said, I've never had any error untill a few days ago.
I've an MYSQL-server with Server version 5.0.51a-24+lenny3-log and phpMyAdmin is version 5.0.32
Below you can find my code (it could be possible that there are some translating errors since the coding is done in Dutch but I translated it to English to post here). I've also let out everything that had to do with the layout so this is the basic code I use to update my database with FCKeditor.
<?php include('config.php'); if(!isset($_SESSION['gebruiker'])) { header("Location: index.php"); } $query="SELECT * FROM table1 WHERE id='" .$_GET["id"]."'"; $result = mysql_query($query) or die ("Error1: " . mysql_error()); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <?php include_once("fckeditor/fckeditor.php") ; ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" > <link href="adminsystem.css" rel="stylesheet" type="text/css" > </head> <body> <?php // Getting information and assigning it to temporary variable while ($rij = mysql_fetch_array($result)){ $name = $row['name']; $guide = $row['guide'] ; } ?> <FORM ACTION="<?php echo($_SERVER["PHP_SELF"]);?>" METHOD="post"> Name: <br><INPUT TYPE="text" NAME="naam" SIZE=30 MAXLENGTH=120 value="<?php echo($name);?>"> <br> <?php $oFCKeditor = new FCKeditor('FCKeditor1') ; $oFCKeditor->BasePath = '/fckeditor/' ; $oFCKeditor->Width = '100%'; $oFCKeditor->Height = '500'; $oFCKeditor->Value = $guide ; $oFCKeditor->Create() ; $sValue = stripslashes( $_POST['FCKeditor1'] ) ; ?> <input type="hidden" name="Confirm" value="1"> <input type="hidden" name="id" value="<?php echo($_GET["id"]);?>"> <INPUT TYPE="Submit" VALUE="Change"> <input type="Button" value="Back" onclick="javascript:history.back();"> </form> <?php if (isset($_POST["Confirm"])) { $query = "UPDATE table1 SET name='$_POST[name]', guide='$_POST[FCKeditor1]' WHERE id = '".$_POST["id"]."'"; mysql_query($query) or die ("Error2: " . mysql_error()); header("Location: index.php"); } else { } ?> </body> </html>
Re: Can't update database
Re: Can't update database
Thanks, that was the solution to my problem =)
It works flawless again.
And about the unwrapping before showing it again, it looks like that isn't needed. I haven't changed my code to view the guides and everything still works as it should.
Again a big thanks for your help