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
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(287) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/printthread.php(287) : eval()'d code 2 errorHandler->error
/printthread.php 287 eval
/printthread.php 117 printthread_multipage



UserSpice
Running Update Query - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Miscellaneous (https://userspice.com/forums/forumdisplay.php?fid=28)
+--- Forum: Off-topic Discussions (https://userspice.com/forums/forumdisplay.php?fid=10)
+--- Thread: Running Update Query (/showthread.php?tid=381)

Pages: 1 2 3 4


Running Update Query - Brandin - 03-18-2017

I've almost mastered this...almost is keyword. I am trying to bind LIMIT variable. I'm testing this prior to using it for my pagnation. However, when I use the following statement, it returns an empty array:
Code:
$q = $db->query("SELECT * FROM dates WHERE dateclosed = ? AND user_id = ? LIMIT ?", array(0,$uid,1));

But when I run:
Code:
$q = $db->query("SELECT * FROM dates WHERE dateclosed = ? AND user_id = ? LIMIT 1", array(0,$uid));

It runs fine and returns a good array, but the point of PDO is to bind variable, I'm eliminating this purpose of I end up putting
Code:
LIMIT $start,$finish
right into the statement.

Thoughts? Thanks in advance!


Running Update Query - mudmin - 03-19-2017

I don't think there is any kind of downside to not binding those variables. There really isn't anything anyone could inject into that limit that could be a real security vulnerability to you. I guess it's possible, but I think you're ok.


Running Update Query - Brandin - 03-19-2017

Sweet, I shall continue! Was just concerned something could go wrong Big Grin