473,473 Members | 1,951 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

deleting a row (php hyperlinking)

6 New Member
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

Expand|Select|Wrap|Line Numbers
  1.  <h1>Booking Table (Unconfirmed Booking)</h1>
  2.  
  3. <?php
  4.  
  5. include("config.php");
  6.  
  7. $con = mysql_connect($mysql_host, $mysql_user, $mysql_password); 
  8.  
  9. mysql_select_db($mysql_database, $con); 
  10.  
  11. $result = mysql_query("SELECT * FROM names");
  12.  
  13. echo "<table border='1'>
  14. <tr>
  15. <th>Booking ID</th>
  16. <th>Firstname</th>
  17. <th>Lastname</th>
  18. <th>Adress</th>
  19. <th>City / Town</th>
  20. <th>Postcode</th>
  21. <th>Phone Number</th>
  22. <th>E-Mail</th>
  23. <th>Cottage</th>
  24. <th>Start Date</th>
  25. <th>End Date</th>
  26. <th>Conformation</th>
  27. <th>Confirm Booking</th>
  28. <th>Delete Booking</th>
  29. </tr>";
  30.  
  31. while($row = mysql_fetch_array($result))
  32.   {
  33.   echo "<tr>";
  34.   echo "<td>" . $row['id'] . "</td>";
  35.   echo "<td>" . $row['firstname'] . "</td>";
  36.   echo "<td>" . $row['lastname'] . "</td>";
  37.   echo "<td>" . $row['address'] . "</td>";
  38.   echo "<td>" . $row['citytown'] . "</td>";
  39.   echo "<td>" . $row['postcode'] . "</td>";
  40.   echo "<td>" . $row['phonenumber'] . "</td>";
  41.   echo "<td>" . $row['emailaddress'] . "</td>";
  42.   echo "<td>" . $row['cottage'] . "</td>";
  43.   echo "<td>" . $row['startdate'] . "</td>";
  44.   echo "<td>" . $row['enddate'] . "</td>";
  45.   echo "<td>" . $row['conformation'] . "</td>";
  46.   echo "<td>" . Confirm . "</td>";
  47.   echo "<td>" . Delete . "</td>";
  48.   echo "</tr>";
  49.   }
  50. echo "</table>";
  51.  
  52. mysql_close($con);
  53. ?>
  54.  
  55. <p>
  56.   <INPUT type="button" value="Log Out" onClick="location.href='adminlog.php'">
  57.   <html> 
Jun 15 '10 #1
4 1464
Mayur2007
67 New Member
Hello,

Replace line no 46 & 47 by the following code
Expand|Select|Wrap|Line Numbers
  1. echo "<td><a href='yourfile.php'>Confirm</a></td>";
  2. echo "<td><a href='yourfile.php'>Delete</a></td>"; 
  3.  
Regards,
Mayur Bhayani
Jun 16 '10 #2
manupr
6 New Member
thanks you so much mate tried piece of code like this they didnt work this one does thanks alot
Jun 16 '10 #3
manupr
6 New Member
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
Jun 16 '10 #4
Mayur2007
67 New Member
Hello,

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

Thanks & Regards,
Mayur Bhayani
Jun 17 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Google Mike | last post by:
I'm about to come out in a few months with a new company and a new product that is PHP-based. I'm working on a user guide and programming guide that comes out with it. At the bottom on the first...
1
by: Sebastian | last post by:
Hi I got a little problem with deleting from my database, i'm making a simple newsscript. I get a Parse error: syntax error, unexpected T_ELSE on line 24, I have written the error as a comment...
2
by: Mikro | last post by:
Hi! Please help me to get this work. <?php if(isset($delnews)) { ?> <script language="JavaScript"> function deleting() var answer = confirm ("Delete record?) if (answer){ <?php
4
by: Fughal | last post by:
Hi, I have a big DB2 database and I need this database without any Data in it for testing something. I have made a backup of these db and restore it on a testing system. My Problem is now how...
2
by: azmiza | last post by:
Hi everybody, I need your help. I want to view my sql database and its work very well which is display in my web browser but once I want to press button yes, its not working, I check the...
4
by: arizal | last post by:
Hi , I am trying to figure out why my PHP code to delete multiple value by selecting the checkbox is not working. My php code is listed as below <?php $sql = "Select * from list;";...
13
by: programming | last post by:
how do i delete from a text file 1 of the following lines: jon|scott adam|smith <--delete paul|clark say i would like to delete the middle line of this txt, in member.txt what php code or...
3
Odisey
by: Odisey | last post by:
I am not sure if this is a MySQL syntax error or a DB issue yet. I am getting the error from the code: Page Error! This page has been accessed in error. The GET is populated in the browser...
13
by: shotokan99 | last post by:
i have this code that when the user click it will delete the record: echo' <td bgcolor="'.$color.'" width="40"><font face="Verdana" size="1"> <a...
6
by: keeps21 | last post by:
I'm having a bit of trouble creating a page to delete a story from the content table in my database. I have checked my DELETE query directly in phpmyadmin and it is working fine. I am echoing...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.