Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Delete Function Error

  1. #11
    Join Date
    Jan 2007
    Location
    Surrey, UK
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I realised that without the ! it would not show any entries. So I sent the parameter cmd=xxx. That allowed me to see things but wasn't going to attempt an edit or delete.

    I then simply clicked on delete and that worked fine. Having deleted a couple of items, I found a way to create my own item and added it. (Just so the page wouldn't be blank for anyone else!)

  2. #12
    Join Date
    Aug 2006
    Location
    Ohio
    Posts
    266
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hmm, I took the ! back out and did what you did and it worked fine, but the news articles do not show up on the edit_news.php. It seems that there is something preventing it from showing the news there when there is no !, but allowing the delete function to work. Then when the ! is added back in, it displays the articles on edit_news.php, but the delete function does not work. Anyone see something in the code that may be causing this?

  3. #13
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Well, then there's an error in the logic. You should find another way to check to see what it should do.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #14
    Join Date
    Jan 2007
    Location
    Surrey, UK
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I think you problem is the oreder in which you do things.

    You should first of all handle commands like edit or delete.

    Then you should should show existing entries - and don't test isset($cmd) because you want to show existing entries whether or not you're sending a command.

  5. #15
    Join Date
    Aug 2006
    Location
    Ohio
    Posts
    266
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by mike_p View Post
    I think you problem is the oreder in which you do things.

    You should first of all handle commands like edit or delete.

    Then you should should show existing entries - and don't test isset($cmd) because you want to show existing entries whether or not you're sending a command.
    Thanks for the idea, I'll try it and let you know how it works out

  6. #16
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Yeah. if ($cmd == THIS) do THAT; ...etc
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #17
    Join Date
    Aug 2006
    Location
    Ohio
    Posts
    266
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks a ton guys, I rewrote the code and got it working perfectly, even got an edit feature up and running

  8. #18
    Join Date
    Sep 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Titan85 View Post
    Thanks a ton guys, I rewrote the code and got it working perfectly, even got an edit feature up and running
    Man, I am strugling with the exact same thing, driving me nuts.
    Could you please post your working version of the delete and edit so i can learn from it.

    Thanks!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •