01-07-2019, 10:31 AM
Hi. Sorry. Pretty much all the devs have been away this weekend. Sorry for the slow response.
As far as the first vs second, I'll take another look. the way I wrote the query is shorter. In general if you can avoid the paranthesis and ` vs ' there are fewer chances for a mistake.
Ready for something that will change your life and I went 2 years without knowing? ...
After your query that doesn't work, you can just type
dump($db->errorInfo()); and you will get PDO's best guess as to what's wrong with your query. If you get some array with just 012, that means it worked as far as PDO/MySQL is concerned.
You can bind as many variables as you want with the ? thing if that's what you're talking about. And you really don't have to bind that P, like I moved from the query to the bound parameters, but I always do it in case I want to sub it out with a variable later.
I think the $db->delete only works with one parameter. I usually only use that with an ID. I like to write out my delete queries, personally.
As far as the first vs second, I'll take another look. the way I wrote the query is shorter. In general if you can avoid the paranthesis and ` vs ' there are fewer chances for a mistake.
Ready for something that will change your life and I went 2 years without knowing? ...
After your query that doesn't work, you can just type
dump($db->errorInfo()); and you will get PDO's best guess as to what's wrong with your query. If you get some array with just 012, that means it worked as far as PDO/MySQL is concerned.
You can bind as many variables as you want with the ? thing if that's what you're talking about. And you really don't have to bind that P, like I moved from the query to the bound parameters, but I always do it in case I want to sub it out with a variable later.
I think the $db->delete only works with one parameter. I usually only use that with an ID. I like to write out my delete queries, personally.