The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
db where var1=x AND var2=y AND var3=q
#6
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.
  Reply


Messages In This Thread
db where var1=x AND var2=y AND var3=q - by Ruud - 01-05-2019, 06:10 PM
RE: db where var1=x AND var2=y AND var3=q - by mudmin - 01-07-2019, 10:31 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)