Jump to content

Recommended Posts

        <td class="TableArea"><div align="center"><a href='kill.php?delete=$buttock->id'>Delete</a></td>

Thats the link to delete the search.

 

PHP:

if (strip_tags($_GET['delete'])){

mysql_query("DELETE id FROM search WHERE id='$buttock->id'");

echo "You deleted the search.";

}

 

When I click on the link it says "You deleted the search." But it doesn't, help?

Link to comment
https://forums.phpfreaks.com/topic/120695-solved-deleting-seperately/
Share on other sites

$s_query=mysql_query("SELECT * FROM search WHERE username='$username' ORDER by id DESC");

$numeros=mysql_num_rows($s_query);

 

if (strip_tags($_GET['delete'])){

mysql_query("DELETE FROM search WHERE id='$buttock->id'");

echo "You deleted the search.";

}

 

  <? while($buttock = mysql_fetch_object($s_query)){ ?>

 

        <td class="TableArea"><div align="center"><a href='kill.php?delete=<? echo"$buttock->id"; ?>'>Delete</a></td>

 

 

Not these are not together, I got the information which is linked to the deletion.

what happens in the browser window may have little to nothing to do with what happens on the server. ignore what the button says. the point is that the id isn't set in the code where you expect it to be. the problem is that you are invoking $buttock before $buttock is created. $buttock is created here, but you use it before here:

 

while($buttock = mysql_fetch_object($s_query)){

 

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.