w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
how to parse the contents of a particular row of a html table into array

It isn't entirely clear what you're trying to do. If you want to take data from an HTML table row and send it to a PHP array after a click then you'll need to use javascript.

Keep it simple. Create a link that sends the data to whatever URL/file does the processing:

while ($row = mysql_fetch_array($reslt)) {   
        <td><?php echo $row['room_name'] ?></td>
        <td><?php echo $row['date'] ?></td>
        <td><?php echo $row['s_at'] ?>hrs</td>
        <td><?php echo $row['e_at'] ?>hrs</td>
        <td><a id="my_link" href="some_file.php?room_name=<?php
echo $row['room_name'] ?>&date=<?php echo $row['date']
?>&s_at=<?php echo $row['s_at'] ?>&e_at=<?php echo
$row['e_at'] ?>"><input type="image" src="../images/cross.png"

The data will then be available to some_file.php in $_GET.

Note that you can still use javascript to process this dynamically. You could add a click function to the link, so that when it is clicked, it does an AJAX call using the href value. For example:

$('#my_link').click(function() {
        url: this.href

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.