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!
I have a page that lists the user and has an option to delete the record. But I can not get it to delete the record. I believe that I am passing the correct information but it just will not delete. It just goes to delete.php and displays a blank name. The pop up that I have before it switches pages post the correct info. Where am I going wrong?
Firstly, you should be wrapping your array indexes with quotes (single quotes, preferably). I won't go into why - just do it.
Next, I imagine the reason you are not seeing any records deleted is because you have an extra '$' on the end of your $user_id variable.
You should have been able to debug this very rapidly. When things don't happen the way you expect them to, have a look at what the variables contents are. In this case, you would have noticed that $_GET['id'] (notice the quotes) held something like '10$'. You would have then deduced that the trailing dollar sign was the problem. Then you would have located where this dollar sign was being added.