MySQL SELECT works but DELETE doesnt

  • mindfullsilence
  • Professor
  • Professor
  • User avatar
  • Posts: 854

Post 3+ Months Ago

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.
  • mindfullsilence
  • Professor
  • Professor
  • User avatar
  • Posts: 854

Post 3+ Months Ago

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!
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9101
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

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!
  • mindfullsilence
  • Professor
  • Professor
  • User avatar
  • Posts: 854

Post 3+ Months Ago

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

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 67 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.