Jump to content

h4v0c

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

h4v0c's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i would serisouly buy you two a beer right now. thanks so much guys.  ;D
  2. PHP version: 4.4.4 MySQL version: 4.1.2 Error: 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 's style of relating when things are going well and in conflict. Code: [code] $host = "server URL" ; $login = "user name" ; $pwd = "password" ; $db = "clientd_psp" ; $conn = mysql_connect("$host", "$login", "$pwd") or die('SQL Error: '.mysql_error().'') ; mysql_select_db($db, $conn) ; $edit = stripslashes($_POST['PSP_editor']); $page = $_POST['page_id_value']; $result = mysql_query("UPDATE `content_tbl` SET `page_content`='$edit' WHERE `page_id`='$page'"); if(!$result)     echo mysql_error(); [/code] wtf? the query should be perfect. what gives?
  3. Hi, Its me again I asked a question concerning saving posted data out of the FCKeditor v.2.3.1 in the thread below: http://www.phpfreaks.com/forums/index.php/topic,106562.msg426288.html (Thanks to xyn, who was very helpful) I got that problem solved, but now the editor only saves to the first row in the database. Just to sum it up again: The editor is passed the page ID from a page listing. Editor then loads the data using this query: [code]<?php mysql_connect("server URL", "user name", "password") or die ('I can?t connect to the database.') ;  mysql_select_db("clientd_psp") ; $pagedid = $_GET['id']; $posted_id = $_POST['id']; $result = mysql_query("SELECT * FROM content_tbl WHERE page_id=$pagedid") ; $row = mysql_fetch_array($result) ; echo "<div style=\"font-size:18px;\">" . $row['name'] . "</div><br />" ; //$sBasePath = $_SERVER['PHP_SELF'] ; //$sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ; $oFCKeditor = new FCKeditor('PSP_editor') ; $oFCKeditor->BasePath = '/psp/fckeditor/' ; $oFCKeditor->Value = $row['page_content'] ; $oFCKeditor->Height = '500' ; $oFCKeditor->Create() ; echo ("<input type='hidden' value='$pagedid' name='page_id_value' />") ; ?>[/code] This part works flawlessly. The problem I have is that when posting it to this script: [code]<?php$host="server URL" ; $login="user name" ; $pwd="password" ; $db="clientd_psp" ; $conn = mysql_connect("$host", "$login", "$pwd") or die('SQL Error: '.mysql_error().'') ; mysql_select_db($db, $conn) ; mysql_query("UPDATE content_tbl SET page_content='".stripslashes($_POST['PSP_editor'])."' WHERE page_id='".$_POST['page_id_value']."'") ; ?>[/code] This only works when page_id is 100(the very first row in the database) I have no idea whats going, and I am definately a php noob, so I am at a loss as to whats going on with it not working. Like I said, its a problem with every row except the first one. Does anyone have any experience in using this wysiwyg?
  4. Thank you so much. the second one fixed it, now it works perfectly. OMG THANKS SO MUCH!  ;D
  5. Hi All, Im relatively new to php and am working on a project for a client. I am using the FCKeditor(www.fckeditor.net)  version 2.1. The webserver the PHP is running on is(to my knowledge) windows 2000 server, and the PHP version on the server is the latest stable version(which I dont remember the actual number). The editor is posting the data to my script. My post handler script is as follows: [code] $sValue =  stripslashes( $_POST['PSP_editor'] ) ; $posted_id = $_POST['page_id_value'] ; mysql_connect("database URL", "Username", "Password") or die ('I can?t connect to the database.') ; mysql_select_db("clientd_psp") ; mysql_query("UPDATE content_tbl SET page_content=$sValue WHERE page_id=$posted_id") ; [/code] Obviously I have changed the URL, username and password. This has me stumped, if I comment out the mysql commands and have it echo the 2 variables and they come back with the correct data, but it refuses to successfully update the fields. I do have read and write access to the database as I entered the content into the DB. Whats up? Thanks is advance, John
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.