$row[0] is the id of the database.
- Code: Select all
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
and here is the code for the checkboxes.
- Code: Select all
echo "<tr class=\"d".($i & 1)."\"><td align=\"left\">";
echo "<h2><font color=#000000>Visit <input type=\"checkbox\" class=\"chcktbl\" value=\"$row[0]\" /></font>$row[0] $row[6]</h2><em><strong><font color = #FF0000>Sale is on $slongdate until $elongdate.
~ Times are $mystime to $myetime</strong></em></td>";
</tr>
The second $row[0] inserted after '</font>' is just to make sure that each $row[0] entered in to the table has the id from the database.
The problem is that all I get from the checkbox is a value of 1 for the $row[0].
Here's the javascript.
- Code: Select all
var visitcount =0;
var mylink =0;
$('.chcktbl').click(function () {
visitcount = $('.chcktbl:checked').length;
mylink = $('.chcktbl').val();
alert(mylink+' '+visitcount);
});
The 'visitcount' works fine, but not the value for $row[0].
I've tried many combinations using single quotes, double quotes etc, but I get either 'on' suggesting no value is attached to the checkbox or 1. If I replace the $row[0] with a number then I get that number showing in the js alert box.
Anyone tell me what I am doing wrong here, please?


