Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

215
Views
Symbols Cannot be posted with ajax

i have a inline editing on table. if the table contains special chars and symbols ajax cannot post it properly

TABLE.PHP

<script>
    function showEdit(editableObj) {
        $(editableObj).css("background","#FFF");
    } 

    function saveToDatabase(editableObj,column,id) {
        $(editableObj).css("background","#FFF url(loaderIcon.gif) no-repeat right");
        $.ajax({
            url: "saveedit.php",
            type: "POST",
            data:'column='+column+'&editval='+editableObj.innerHTML+'&id='+id,
            success: function(data){
                $(editableObj).css("background","#FDFDFD");
            }        
       });
    }
    </script>

<td style="vertical-align:top" contenteditable="true" onBlur="saveToDatabase(this,'PNAME','<?php echo $faq[$k]["ID"]; ?>')" onClick="showEdit(this);"><?php echo $faq[$k]["MSG"]; ?></td>

SAVEEDIT.PHP

<?php
require_once("DBcontroller.php");
$db_handle = new DBController();
$editval = mysql_real_escape_string($_POST["editval"]);
$result = mysql_query("UPDATE ARTICLE SET " . $_POST["column"] . " = '$editval' WHERE  ID=".$_POST["id"]);?>

I WANT POST "Spine Tenderness ↓+, LS & Rt.Gluteal regions, Muscle spasm ↓+, ROM pain ↓ & improved" THIS CONTENT IN TABLE TO SAVEEDIT.PHP AND UPDATE IT IN DATABASE

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Follow these steps if you want to store spacial char in database table.

step1: change your table's Collation- utf8_unicode_ci

step2: Also change fields Collation - utf8_unicode_ci

Step3: Go to the your db config file

Step4: After connecting to the database put following code.

mysql_query("SET NAMES utf8"); // or

mysql_query("utf8");

That's all. Hope it will help

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!