MySQL SELECT works but DELETE doesnt

  • mindfullsilence
  • Professor
  • Professor
  • User avatar
  • Joined: Aug 04, 2008
  • Posts: 846
  • Status: Offline

Post March 31st, 2012, 9:26 pm

Anyone know why selecting from the database would work just fine with php PDO execute() but trying to delete a row doesn't even pass the query to MySQL?

My select statement:
Code: [ Select ]
SELECT * FROM player


My delete statement:
Code: [ Select ]
DELETE FROM player WHERE playerid=5


If there's nothing wrong with my SQL syntax let me know and I'll post my php code that I'm using to submit the queries.
Use your words like arrows to shoot toward your goal.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post March 31st, 2012, 9:26 pm

  • mindfullsilence
  • Professor
  • Professor
  • User avatar
  • Joined: Aug 04, 2008
  • Posts: 846
  • Status: Offline

Post March 31st, 2012, 9:30 pm

Good lord I hate that, debug for 3 hours and can't figure it out and then post about it and instantly figure out the problem. Had my id in the query as an argument in my PHP function. But wasn't passing in the argument when calling the method (e.g. delete_player() instead of delete_player(5)).

Glad you figured out your problem, sometimes the simplest problems are the most time consuming to find!
Use your words like arrows to shoot toward your goal.
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8926
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post April 1st, 2012, 1:27 pm

You might start posting it here after 15 minutes of debugging, and then you will solve it right away due to that fact. Maybe there is some magical influence Ozzu has on your debugging skills that enables you to solve problems quickly :)

Glad you figured out your problem! Sometimes the simplest problems are the most time consuming to fix!
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • mindfullsilence
  • Professor
  • Professor
  • User avatar
  • Joined: Aug 04, 2008
  • Posts: 846
  • Status: Offline

Post April 1st, 2012, 3:52 pm

heh, I'll try that. You're about to see me blow up your forum with posts anytime I get stuck on something more than 5 minutes :lol: j/k
Use your words like arrows to shoot toward your goal.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 211 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.