-4

help me please, I have this:

<div id="account_right_earn_total">
<table id = "all_tasks">
<col width="5%" />
<col width="45%" />
<col width="30%" />
<col width="10%" />
<col width="10%" />

<tr>
<td>Title 1</td>
<td>Title 2</td>
<td>Title 3</td>
<td>Title 4</td>
<td>Title 5</td>
</tr>
</table>
<br />

<?php
$query = "SELECT * FROM task2";
$result = mysqli_query($conn,$query);

while($row = mysqli_fetch_array($result)) {
echo '<a href = "extended_task.php" ><div id = "div_table">';
echo '<table id = "all_tasks">';
echo '<col width="5%" />
<col width="45%" />
<col width="30%" />
<col width="10%" />
<col width="10%" />
';
echo '<tr>';
echo '<td>' . $row[0] . '</td>';
echo '<td>' . '<a href = "#">' .$row[2] . '</a>' . '</td>';
echo '<td>' . '<a href = "'.$row[3].'">' . $row[3] . '</a>' . '</td>';
echo '<td>' . $row[6] . " руб" . '</td>';
echo '<td>' . $row[7] . '</td>';
echo '</tr>';
echo '</table>';
echo '</div></a>';
}

?>

</div>

I need to get the $row[0] because it's the id of short-written review of some tasks, and getting that with jQuery I'll send it with AJAX to another php-handler for to get more information. So, help me to get this $row[0]. Thanks)

1 Answers1

0
$('#all_tasks').children('tr:first');

This will give the first <tr> or row in the table with id all_tasks.

Iceman
  • 6,035
  • 2
  • 23
  • 34
  • 1
    Thank you for your answer) Sorry, but it didn't help me.. Thanks to all who minused my question and even didn't tried to help. But today I found the answer here http://stackoverflow.com/questions/376081/how-to-get-a-table-cell-value-using-jquery – Alexander Seryogin Jul 08 '16 at 16:33