Jump to content

Why wont this delete data?


hopbop

Recommended Posts

hello i have this code here to delete people form a call list but it is not deleting form it  could I get a some help?

 

the form

<?php
						include '../config.php';
						$query="SELECT * FROM call_list WHERE ecs = 'Jam' order by date desc";
						$result=mysql_query($query);
						echo mysql_error();
						//////////////// Now we will display the returned records in side the rows of the table/////////
						while($row = mysql_fetch_array($result))
						{
						echo "
							<table id='call_list'>
								<form name='Call_delet' action='del.php' method='get'>
									<tr>
										<td class='call_names'>
											$row[Fname] $row[Lname]
										</td>
										<td class='call_numbers'>
											$row[phone]
										</td>
										<td class='call_email'>
											$row[email]
										</td>
										<td class='call_email'>
											$row[calltime]
										</td>
										<td>
											<a href='del.php?del=$row[id]'>Del</a>
										</td>
									</tr>
								</form>
							</table>
						";
						}
					?>

del.php page

 

<?php	
include '../config.php';
if (isset($_GET['id']) && is_numeric($_GET['id']))
{
$id = $_GET['id'];
$result = mysql_query("DELETE FROM call_list WHERE id=$id")
or die(mysql_error()); 
header("Location: view.php");
}
else
{
echo"dident work";
}

?>

Link to comment
Share on other sites

1. echo $_GET['id']

2. try putting single quotes around $id in your query

 

 

thank you for the reply this did help me once I tryed to echo $_GET['id'] i came to the thought that it's not declared id in the url but del so once i cuckeld a bit and my head went to my desk hard (been trying to fig this out for 2 hours ) i replaced $_GET['id'] with $_GET['del'] now it all works thank you ......... I think i need to sleep more lol  :P

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.