MR KHAN COMUTI Leader
MR KHAN COMUTI Leader

Reputation: 55

Listview is not being split as intended

I am trying to create a list view with split buttons. The button that is split should be a delete icon allowing the user to delete the element from the list.

I have read tutorials that say that all you have to do to add a split icon in your list is to add a second link within the list item. The code below works fine until it reaches the delete link, which should have appeared as a delete icon. However it doesn't and just returns as a text hyperlink.

<?php
        //include db configuration file
        include_once("config.php");
        echo '<ul data-role="listview" data-split-icon="delete">';

        //MySQLi query
        $results = $mysqli->query("SELECT customer_id,customer_name,barber_id FROM barber_queue ORDER BY customer_id");
        //get all records from add_delete_record table
        while($row = $results->fetch_assoc())
        {
        echo '<li><a href#her>';                
        $customer_id = $row["customer_id"];
          echo 'Customer ID:';
          echo $row["customer_id"];
          echo 'customername:';
          echo $row["customer_name"];
          echo $row["barber_id"].'</li>';

          echo '</a><a href="delete_customer.php?customer_id='.$customer_id.'"  >Delete</a>';
          echo '</li>';
        }
        echo '</ul>';
        //close db connection
        $mysqli->close();
    ?>

Upvotes: 0

Views: 44

Answers (1)

ezanker
ezanker

Reputation: 24738

The problem is the line:

echo $row["barber_id"].'</li>';

You are closing the <LI> element prematurely.

Upvotes: 1

Related Questions