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' ";

 

 

Link to comment
Share on other sites

So where is $last defined? You're obviously not setting it, so where is it supposed to come from? Is it in the URL (use $_GET['last']). Is it posted? Use $_POST. Session? use $_SESSION.

Otherwise, it's made up and has no use ;)

Link to comment
Share on other sites

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());

Link to comment
Share on other sites

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

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.