Jump to content

[SOLVED] problem deleting


amylou

Recommended Posts

that is the error i am getting

 

 

Notice: Undefined variable: last in C:\apache2triad\htdocs\index.php on line 14 Notice: Undefined variable: first in C:\apache2triad\htdocs\index.php on line 14

 

 

this is the line of code

$query ="DELETE FROM timeoff WHERE last = '$last' AND first = '$first' ";

 

 

the program lets a person go to a form input first and last name click submit and the results are shown with their name , date, adn a check box

 

after the last checkbox there is a link for delteing

 

not sure how i would validate them in this code.

 

 

if($_GET['m'] == 'del' )
{
$requestId = $_GET['id'];
$query ="DELETE FROM timeoff WHERE last = '$last' AND first = '$first' ";

$result= mysql_query($query) or die(mysql_error());

Notice: Undefined index: last in C:\apache2triad\htdocs\index.php on line 13 Notice: Undefined index: first in C:\apache2triad\htdocs\index.php on line 14

 

 

the line of code that it goes to is the

 

$last=$_POST['last'];

$first=$_POST['first']

 

maybe i did not put it in the right spot i put it before the if statement

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.