Jump to content

[SOLVED] Deleting seperately.


Bullet

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)){

 

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.