Jump to content

Archived

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

redarrow

click for yes and delete help lol

Recommended Posts

i just submitted this as an ansaw do you think it will work?

[code]
<?php

//database connection

$query="select * from post";

$result=mysql_query($query);

while($record=mysql_fetch_assoc($result)){

echo $record['description'];


?>
<form method="POST" action"">
<br>
delete post
<br>
<input type="radio" name="yes">click for yes.......
<br>

<?php
}

if(isset($_POST['submit'])){

if($record['description']=="yes"){

$del="delete from post where description='".$record['description']."'";
$del_res=mysql_quey($del);

}
}
?>
<input type="submit" name="submit" value="delete">
</form>
[/code]

Share this post


Link to post
Share on other sites
if($record["description"] == "yes"){
Now lets put $record["description"] into a word, for this function to work
$record["description"] has to be yes

so
if("yes" == "yes"){
$del = "DELETE FROM posts WHERE description = 'yes'";
}

Share this post


Link to post
Share on other sites

×

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.