Passing multiple values from MYSQL/PHP table to jQuery
<p>Basically, I have working solution for this, but I'm wondering if it could (should?) be done better in some other way.</p>

<p>I have table I'm creating in PHP with values from MYSQL. Each item in table has multiple values. In each line there is single link and clicking on this link fires up jQuery function. In each link there is also VALUE attribute with values from multiple MYSQL fields and joined with &amp;&amp;:</p>

<p>PHP code is:</p>

<pre><code>    foreach ($this-&gt;_data as $l)
    {
        ?&gt;
        ...
        &lt;td&gt;&lt;a href="#" class="clickMe" value="&lt;?php echo $l-&gt;data1 . '&amp;&amp;' . $l-&gt;data2; ?&gt;"&gt;Link&lt;/a&gt;&lt;/td&gt;
        ...
        &lt;?php
    }
</code></pre>

<p>And jQuery function to fire up when clickin' on link is:</p>

<pre><code>$(".clickMe").click(function() {
    myData = $(this).attr('value').split('&amp;&amp;');
});
</code></pre>

<p>Script splits string in VALUE attribute on &amp;&amp; and creates an array myData with values:</p>

<p>myData[0] => value passed from $l->_data1 in PHP</p>

<p>myData[1] => value passed from $l->_data2 in PHP</p>

<p>Is this the right way to do it?</p>
