deleting a row (php hyperlinking)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manupr
    New Member
    • Jun 2010
    • 6

    deleting a row (php hyperlinking)

    hi i trying to make a delete row word where i click on the word and i delete the row. the problem is in line 46 and 47 i dont know how to hyberlink the word to go to the othe file i keep getting errors i dont know why.

    any help please

    Code:
     <h1>Booking Table (Unconfirmed Booking)</h1>
    
    <?php
    
    include("config.php");
    
    $con = mysql_connect($mysql_host, $mysql_user, $mysql_password); 
     
    mysql_select_db($mysql_database, $con); 
    
    $result = mysql_query("SELECT * FROM names");
    
    echo "<table border='1'>
    <tr>
    <th>Booking ID</th>
    <th>Firstname</th>
    <th>Lastname</th>
    <th>Adress</th>
    <th>City / Town</th>
    <th>Postcode</th>
    <th>Phone Number</th>
    <th>E-Mail</th>
    <th>Cottage</th>
    <th>Start Date</th>
    <th>End Date</th>
    <th>Conformation</th>
    <th>Confirm Booking</th>
    <th>Delete Booking</th>
    </tr>";
    
    while($row = mysql_fetch_array($result))
      {
      echo "<tr>";
      echo "<td>" . $row['id'] . "</td>";
      echo "<td>" . $row['firstname'] . "</td>";
      echo "<td>" . $row['lastname'] . "</td>";
      echo "<td>" . $row['address'] . "</td>";
      echo "<td>" . $row['citytown'] . "</td>";
      echo "<td>" . $row['postcode'] . "</td>";
      echo "<td>" . $row['phonenumber'] . "</td>";
      echo "<td>" . $row['emailaddress'] . "</td>";
      echo "<td>" . $row['cottage'] . "</td>";
      echo "<td>" . $row['startdate'] . "</td>";
      echo "<td>" . $row['enddate'] . "</td>";
      echo "<td>" . $row['conformation'] . "</td>";
      [B]echo "<td>" . Confirm . "</td>";[/B]
      [B]echo "<td>" . Delete . "</td>";[/B]
      echo "</tr>";
      }
    echo "</table>";
    
    mysql_close($con);
    ?>
    
    <p>
      <INPUT type="button" value="Log Out" onClick="location.href='adminlog.php'">
      <html>
  • Mayur2007
    New Member
    • Aug 2007
    • 67

    #2
    Hello,

    Replace line no 46 & 47 by the following code
    Code:
    echo "<td><a href='yourfile.php'>Confirm</a></td>";
    echo "<td><a href='yourfile.php'>Delete</a></td>";
    Regards,
    Mayur Bhayani

    Comment

    • manupr
      New Member
      • Jun 2010
      • 6

      #3
      thanks you so much mate tried piece of code like this they didnt work this one does thanks alot

      Comment

      • manupr
        New Member
        • Jun 2010
        • 6

        #4
        Hi trying to create a query so in this table it will only display data in my table. IF conformation in the names table equals no display this data.

        I would like to know the code and where to put it please

        thanks

        Comment

        • Mayur2007
          New Member
          • Aug 2007
          • 67

          #5
          Hello,

          Please explain more in details. Not sure what are you looking for...

          Thanks & Regards,
          Mayur Bhayani

          Comment

          Working...