title: what is [object Object]?
body: <p>why instead giving data(value) of database give me the [object Object]?</p>
  
  <pre><code>var dataObj = $(this).closest('form').serialize();
      $.ajax({
          type: "POST",
          url: url,
          data: dataObj,
          cache: false,
          dataType: 'json',
          success: function (data) {
              $(".list_name").show().html('');
                  $(".list_name").append('&lt;p&gt;&lt;a href="" id="result"&gt;' + data + '&lt;/a&gt;&lt;/p&gt;');
                  $('.list_name p a').click( function(e) {
                                  e.preventDefault();
                                  $('&lt;b&gt;' + b + '، &lt;/b&gt;&lt;input type="text" name="hotel[]" value="' + b + '" style="border: none; display: none;" /&gt;').appendTo($('.auto_box span'));
                                  $(this).remove();
                              return false;
                              });
              });
  </code></pre>
  
  <p>results url is:(json_encode()) : </p>
  
  <pre><code>[{"name":"333333"},{"name":"\u0633\u0644"},{"name":"\u0633\u0644\u0627\u0633\u06cc"},{"name":"\u0633\u0644\u0627\u0633\u0633"},{"name":"\u0633\u0644\u0627\u0645"}]
  </code></pre>
  
  <p>update: full code:</p>
  
  <pre><code>$('.auto_complete').keyup(function () {
          var id = '#' + this.id;
          var alt = $(id).attr('alt'); var id = $(this).attr('id'); var name = $(this).attr('name');
          var url = alt + id + '/' + name;
      var dataObj = $(this).closest('form').serialize();
  $.ajax({
      type: "POST",
      url: url,
      data: dataObj,
      cache: false,
      dataType: 'json',
      success: function (data) {
          $(".list_name").show().html('');
          for (i in data) {
              var obj = $('&lt;a href="" id="result"&gt;' + data[i].name + '&lt;/a&gt;');
              obj.click(function(e) {
                              e.preventDefault();
                              $('&lt;b&gt;' + b + '، &lt;/b&gt;&lt;input type="text" name="hotel[]" value="' + b + '" style="border: none; display: none;" /&gt;').appendTo($('.auto_box span'));
                              $(this).remove();
                          return false;
                          });
               var p = $('p');
               p.append(obj);
               $(".list_name").append(p);
          }
     },
          "error": function (x, y, z) {
              // callback to run if an error occurs
              alert("An error has occured:\n" + x + "\n" + y + "\n" + z);
          }
          });
  
      });  
  </code></pre>