Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Actually if you think of it in the simpler form it is easy, I will explain. </p> <p>You want basically an array of the table [uid]=>points right, well set up a page to do just that all the php page does is run your query and print the results in a delimited fashion. So on your php page do something like this:</p> <pre><code>&lt;? if($result &gt; 0){ $string = ""; foreach($result as $key =&gt; $value){ $string = $key.','.$value.'|'; } } //then trim the $string to remove the very last pipe. $final_value = trim($string,'|'); //now echo this to the page and put it into a div say id=results //now in your div you can do all the styling here or in your //final page it deosn't matter. ?&gt; &lt;div id="results"&gt; &lt;?= $final_value ?&gt; &lt;/div&gt; </code></pre> <p>or you could use the array here and create the view within results and the js will just pull the html from here so that this page does all the heavy lifting but that is dependant on your requirements. i.e. how the results will be displayed and all. if it will be grouped together then doing everything here is fine. </p> <p>Now on your other page the regular one just add this jQuery: </p> <p>If you wanted to you could use click handlers to send variables to a function to build the query on the fly (using say checkboxes and a button or link to getScript: </p> <pre><code>function getScript(){ //to get all checked boxes and glue as one variable you could do this: $("input:checked").each(function(){ var uids = []; var points = $(this).val(); uids.push(points+'|'); }); //cleanup var final_string = $.trim(uids); $('#result').load('your/php/file.php?uid='+final_string+' #results', function() { //the #results tells jquery to get the contents of this page only from //the #results div. so the #results content will be placed into the //result div on this page when the button is clicked. only thing //you have to do now is in this section call another js function //to parse the returned string or do it on the php page in the #results //div and show the html here on this page. your choice. }); </code></pre> <p>now i took a few things for granted like you know how to connect to sql and return the results as an array that kind of thing but if you need more direction on the js here just comment back and i will be happy to elaborate further on any part for you. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload