Click here to Skip to main content
15,900,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
PHP
<?php
		include '../forms/includes/connection.php';
		
		if (isset ($_POST['Delete']))
	
	{	

		$id = $_POST['booking_request_id'];
		$sql = "DELETE from booking_requests where `booking_request_id` ='$id'";
		$query = mysqli_query ($link,$sql);
		
		
		if ($query)
	{
		header('location:whatsBooked.php');	
	}
	else
	{
		echo "Error: Record was not deleted" .mysql_error();
	}
	
	}
	
	else 
		
	echo "Error" .mysql_error();


The first if statement is not being fulfill, any help?
Posted
Updated 24-Apr-15 8:26am
v6

1 solution

C#
//What is $link variable? check your query in database whether it is working or not.


see the reference functionality code here
http://www.tutorialspoint.com/php/mysql_delete_php.htm[^]
 
Share this answer
 
Comments
Ray-Rae 15-Apr-15 9:05am    
$link = mysqli_connect ($dbhost,$dbuser,$dbpass);

Yes it does work

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900