Welcome Guest, Not a member yet? Register   Sign In
Get ID from database when a specific td is clicked
#3

(This post was last modified: 01-03-2018, 06:18 AM by waqaskhanbhatti.)

You problem is not clear to me but maybe this is a possible solution.

You can create a loop counter variable at top of the foreach loop and use this counter as row no in your code for example.


PHP Code:
$row_no 0;
foreach (
$query->result() as $row){
        
$row_no++;
 
       echo "<tr data-row-no="$row_now .">";
 
       echo "<td><input type='checkbox'></td>";
 
       echo "<td>" $row->klantnaam "</td>";
 
       echo "<td class='kiesproject'>" $row->project "</td>";
 
       echo "<td>" $row->projectid "</td>";
 
       echo "<td>" $row->started "</td>";
 
       echo "<td>" $row->agenten "</td>";
 
       echo "<td>" $row->nog_benaderen "</td>";
 
       echo "<td><a href='http://managementtool/index.php/Home/terugbel'>" $row->terugbellen "</td></a>";
 
       echo "<td>" $row->BMNRUIT "</td>";
 
       echo "<td>" $row->parkeer "</td>";
 
       echo "<td>" $row->maxdatum "</td>";
 
       echo "<td>" $row->Eff_duur "</td>";
 
       echo "<td>" $row->InEff_duur "</td>";
 
       echo "</tr>";

 then with the help of jquery you can find the parent element of the clicked TD and then get the data attribute and get row no. like this.
Reply


Messages In This Thread
RE: Get ID from database when a specific td is clicked - by waqaskhanbhatti - 01-03-2018, 06:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB