Jump to content

Search the Community

Showing results for tags 'json_encode'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 2 results

  1. I have an autocomplete() function connected to a MYSQL database. The jquery is completely run of the mill: $(function() { $(".choose_venue").autocomplete({ source: "list_venues.php", minLength: 1 }); }); ...and if I manually add a query such as "list_venues.php?term=Ku" onto the URL of list_venues.php, then that page gives a appropriate response (such as the following): [{"name":"Fonderie Kugler"},{"name":"Kulturhaus Helferei"},{"name":"Kunstraum Walcheturm"}]So, a simple `input` such as the following *should* be working: <input type="text" style="width:270px;" class="choose_venue"/> However, the output I get is a window containing no text, but just a number of faint lines. I first thought that this might be something in my CSS, but the problem persists even when ALL css modifications have been removed. My next thought was that it might be a browser issue (I use Safari), but Chrome behaves exactly the same way. The only other idea I had was that the jquery files I was calling were out of date or that there was some other problem, but I tried multiple links and I always get the same result. As of my most recent attempts I am linking to the following files: <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css"> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> It appears that the number of these grey lines corresponds to the number of text values that should be returned. But beyond that, I have no idea what is causing this.
  2. Please have a look at my json data to see what I want to do: [ { "weID": "-126555895", "size_h": "700", "size_w": "494", "images": [ { "imgID": "1535689403", "imgName": "1321865407" } ], "text": [ { "txtID": "-1892792786", "txtText": "4.99" }, { "txtID": "1583276033", "txtText": "$" } ] }, // i cant seem to loop through my data to get more results looking like this:{ "weID": "3444555435", "size_h": "500", "size_w": "294", "images": [ { "imgID": "-454646555", "imgName": "77774433" }, { "imgID": "1535689403", "imgName": "1321865407" } ], "text": [ { "txtID": "15834443333", "txtText": "more text" } ] }] //my PHP code: $back = mysql_query("SELECT weID, size_h, size_w FROM wb WHERE weID=-126555895");$images = mysql_query("SELECT imgID, imgName FROM wi WHERE weID=-126555895");$text= mysql_query("SELECT txtID, txtText FROM wt WHERE weID=-126555895"); //all my above SQL statements have weID in common, how can I link them together, to show all my results rather then one "-126555895"?? $model = array(); while($e = mysql_fetch_assoc($back)){ $model['weID'] = $e['weID']; $model['size_h'] = $e['size_h']; $model['size_w'] = $e['size_w']; while($h = mysql_fetch_assoc($images)) { $model['images'][] = array( 'imgID' => $h['imgID'], 'imgName' => $h['imgName'] ); while($f = mysql_fetch_assoc($text)){ $model['text'][] = array( 'txtID' => $f['txtID'], 'txtText' => $f['txtText'] );}; };}; echo json_encode ($model); mysql_close($con); I need it to loop through so it can display all the records in
×
×
  • Create New...