mekha Posted September 4, 2012 Share Posted September 4, 2012 Hi guys , i have a problem with mysqli: i am using a ckeditor....and my database is mysqli using!....now.. in every time i update the row..the ckeditor adding:\\r\\n..for example:upd1:\\r\\nupd2:\\r\\n\\r\\nupd3:\\r\\n\\r\\n\\r\\n ex...... i am using: [/size][/font]$mysqli->real_escape_string($row["content_in_ckeditor"]); .. and without clean results :S Link to comment Share on other sites More sharing options...
birbal Posted September 4, 2012 Share Posted September 4, 2012 It is not issue with mysqli_real_escape_string(). showing us the code which is responsible for update would be helpfull. Link to comment Share on other sites More sharing options...
justsomeguy Posted September 4, 2012 Share Posted September 4, 2012 You can use trim to get rid of excess leading and trailing whitespace. http://www.php.net/manual/en/function.trim.php Link to comment Share on other sites More sharing options...
mekha Posted September 5, 2012 Author Share Posted September 5, 2012 no results :S birbal i didnt understand you,what do you mean ? Link to comment Share on other sites More sharing options...
birbal Posted September 5, 2012 Share Posted September 5, 2012 every time i update the row..the ckeditor adding:I said showing that code you are using to updates the rows, would be helpfull. Link to comment Share on other sites More sharing options...
mekha Posted September 6, 2012 Author Share Posted September 6, 2012 ok, this is: my query run: $sqlm = getPageById(); if ($resultm = $mysqli->prepare($sqlm)) { $mypageid = 216; $resultm -> bind_param("i",$mypageid); $resultm->execute(); $resultm->store_result(); $rowsm = $resultm->num_rows; } if($rowsm > 0) { $rowm = fetch($resultm); $pagetitle = $mysqli->real_escape_string($rowm[0]["page_title"]); $pageContent = $rowm[0]["page_content"]; $pageurlname = $mysqli->real_escape_string($rowm[0]["page_name_url"]); } the query: function getPageById() { $sqlStr = "select * from tbl_pages where page_id = ?"; return $sqlStr; } this is my $_POST: $mysqli->real_escape_string ($_POST["page_content"]); this is my "echo": $pageContent = $rowm[0]["page_content"]; Link to comment Share on other sites More sharing options...
justsomeguy Posted September 6, 2012 Share Posted September 6, 2012 Why are you escaping the values you're getting from the database? That's probably the issue. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now