How to send a php array to an ajax call
<p>Hey guys so I have a function that will display results based on a member and the results that show are put into arrays that create sessions so the user can export them into a .csv file.  Now I have a jquery search function where the user will enter keywords and the words that match the results stay and the ones that don't get faded out.  So I am trying to figure out how to modify the existing session array with only the searched results.</p>

<p>I don't know if I would just have to recreate the sessions by creating an array in javascript and sending it by ajax call and create sessions of the results only. </p>

<p>If you could give me a hand I would appreciate it!</p>

<p>David</p>

<p>UPDATE:</p>

<p>maybe this will give a better idea</p>

<pre><code>$tsql ="SELECT username,firstname,lastname,email,phone,status,statuschangedate FROM csvdata WHERE memberview = :username ORDER BY DATEDIFF(statuschangedate,:date)";
$tgetmeminfo=$DBH-&gt;prepare($tsql);
$tgetmeminfo-&gt;execute(array(':username' =&gt; $username,':date' =&gt; $date));
while ($trow = $tgetmeminfo-&gt;fetch(PDO::FETCH_ASSOC)){
    if ($trow['status'] == "Non-Active - Driver Chose Non-Compliance")
    {
        $csvFirst = $trow['firstname'];
        $csvLast = $trow['lastname'];
        $csvEmail = $trow['email'];
        $csvPhone = $trow['phone'];
        $csvDate = $trow['statuschangedate'];
        $csvUser = $trow['username'];
        $timediff = strtotime($date) - strtotime($csvDate);
        $timediff = floor($timediff/86400);

        $sql ="SELECT MailingAdrs FROM insuranceverificationdisclaimer WHERE TraineeUsername = :tusername";
        $getmeminfo=$DBH-&gt;prepare($sql);
        $getmeminfo-&gt;execute(array(':tusername' =&gt; $csvUser));
        while ($row = $getmeminfo-&gt;fetch(PDO::FETCH_ASSOC)){

            $csvAddrs = $row['MailingAdrs'];
            $change = 1;
        }
        if($change != 1)
        {
            $csvAddrs = "No address";
        }
        $change = 0;
        echo "&lt;div&gt;$timediff, $csvFirst $csvLast, $csvEmail, $csvPhone, $csvAddrs&lt;/div&gt;";
        echo "

                                            ";
        $qsestimedif[$i] = $timediff;
        $qsesfirstname[$i] = $csvFirst;
        $qseslastname[$i] = $csvLast;
        $qsesemail[$i] = $csvEmail;
        $qsesphone[$i] = $csvPhone;
        $qsesadd[$i] = $csvAddrs;
        $i++;
    }

}
$_SESSION['noncomptime'] = $qsestimedif;
$_SESSION['noncompfirst'] = $qsesfirstname;
$_SESSION['noncomplast'] = $qseslastname;
$_SESSION['noncompemail'] = $qsesemail;
$_SESSION['noncompphone'] = $qsesphone;
$_SESSION['noncompaddress'] = $qsesadd;
</code></pre>

<p>This is just one of the outlines of how it grabs info and makes the session, there are multiple of these....so once the export button is clicked these sessions are taken into account on the .php export file...I need a way to re-modify or even recreate them when they make a search each time.  </p>
