make a delete code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
M.K_Soft
Forum Newbie
Posts: 6
Joined: Sat Dec 19, 2009 2:01 pm

make a delete code

Post by M.K_Soft »

hi dears.
i have a name in mysql and i wrote this code for delete a row:

<form id="form1" name="form1" method="get" action="Delete.php"><input type="submit" name="<?php echo $name=$row["name"]; ?>" value="Delete" /></form>

i use session in my pages.
in the statistic.php, i show infos and in the delete.php i wanna delete a complete recore for example "where name= M.K_Soft". i can i distinguish the name in the code above and send it to the delete page so that i delete it?

but it doesn't work.
i just wanna send the name in the Delete.php and there i delete it and also back to the statistics.php.

please help me.
thanke you in advance.
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Re: make a delete code

Post by daedalus__ »

buddy you need to post more code. what are you using to delete the record?

also this works:

Code: Select all

 
echo $name=$row["name"];
 
but im going to say that it is wrong. why would you assign a value to a variable and then immediately echo it? do you use it in another place in the page? and if you do then why not declare in another place where it is easier to keep track of it?
M.K_Soft
Forum Newbie
Posts: 6
Joined: Sat Dec 19, 2009 2:01 pm

Re: make a delete code

Post by M.K_Soft »

daedalus__ wrote:buddy you need to post more code. what are you using to delete the record?

also this works:

Code: Select all

 
echo $name=$row["name"];
 
but im going to say that it is wrong. why would you assign a value to a variable and then immediately echo it? do you use it in another place in the page? and if you do then why not declare in another place where it is easier to keep track of it?
hi dear. so appreciate to reply so soon.
i echo that to see it in the next page. i think i just need the name to reove all it's row from the table.
actually, i have a table named "stdb" and one of it's row is "name". i wanna send the "name" parameter to a page called delete. then delete the row which has this para meter and then delete the row.
if there is a better way, please assist me.
thanks.
Post Reply