Nov 21, 2022 13:07
Use that 2nd one .... I forgot that you sand the value in the DB had a time too
Nov 21, 2022 13:06
$this->db->select('userid, roll, amount, txnnumber, bankref, txntype, txndate, authstatus, feetype WHERE UNIX_TIMESTAMP(CONCAT(SUBSTR(txndate,7,4),SUBSTR(txndate,4,2),SUBSTR(txndate,1,2))) <= $entered_date OR UNIX_TIMESTAMP(CONCAT(SUBSTR(txndate,-4),SUBSTR(txndate,4,2),SUBSTR(txndate,1,2))) => $entered_date');
Nov 21, 2022 13:05
try that .... that converts both the entered date and the date in the database to a unix timestamp which is the only "safe" way to compare dates without them being in a proper timestamp format in the database
Nov 21, 2022 13:04
$this->db->select('userid, roll, amount, txnnumber, bankref, txntype, txndate, authstatus, feetype WHERE UNIX_TIMESTAMP(CONCAT(SUBSTR(txndate,-4),SUBSTR(txndate,4,2),SUBSTR(txndate,1,2))) <= $entered_date OR UNIX_TIMESTAMP(CONCAT(SUBSTR(txndate,-4),SUBSTR(txndate,4,2),SUBSTR(txndate,1,2))) => $entered_date');
Nov 21, 2022 12:45
$sid is the value coming from your search box?
Nov 21, 2022 12:32
is it dd-mm-yyyy or mm/dd/yyyy?
Nov 21, 2022 12:31
that's different than what you said it was
Nov 21, 2022 12:31
sigh ... you have to do all sorts of gymnastics then
Nov 21, 2022 12:30
well that was an important piece of information. It's not a date in the database then. The SQL format for dates is yyyy-mm-dd .. is the column varchar?
Nov 21, 2022 12:27
Again, that has nothing to do with the change you made .... almost impossible actually unless you also did something else .... at the worse you would get a PHP error of some sort if it were incorrect.
Nov 21, 2022 12:24
Try including the WHERE as part of the actual select statement.

$this->db->select('userid, roll, amount, txnnumber, bankref, txntype, txndate, authstatus, feetype WHERE DATE(txndate) <= $sid OR DATE(txndate) => $sid');
Nov 21, 2022 12:23
Adding that would not have caused your site to not be able to be reached.
Nov 21, 2022 12:23
That sounds completely unrelated.
Nov 21, 2022 12:23
If you are trying to look for things within a certain date range then you need a single WHERE to check the date range in one shot. I modified my answer to reflect that.
 

 SOCVR Request Graveyard

This room is ONLY to receive action requests (cv-pls, etc.) fr...
Mar 1, 2020 14:43
 

2020 Moderator Election Chat

Open discussion for the Stack Overflow election stackoverflow....
Jul 9, 2020 20:34
@electionbot
Jul 6, 2020 20:04
@ElectionBot What's my candidate score?
 
Jun 10, 2020 05:52
I don't understand why people expect companies to make some of "statement" about things? What happened is of course tragic but SO and company isn't going to make a difference at the end of the day no matter how many statements they might make.
 
May 29, 2020 14:22
You can call it anything you want and run it any way you want to, from a command line, as a service, as a cron job, whatever
May 29, 2020 14:22
You can have it as a "service" on any of the OS platforms ... the only difference is what it's called
May 29, 2020 14:19
You can have it as a "service" on any of the OS platforms ... the only difference is what it's called
May 29, 2020 14:17
Then what I said stands. If it is PHP it's portable.
May 29, 2020 14:11
well if it is supposed to be running in the background all of the time I would certainly make it standalone and start automatically on boot
May 29, 2020 14:05
Ah then you probably want to run it as a service that starts automatically in which case you wouldn't need to worry about interrupts as there would be no "user" or command window
May 29, 2020 14:01
Based on a description of what that Python is doing it looks like you really want to be looking for a threaded PHP solution. Or just use it in conjunction with PHP as its readme mentions :)
May 29, 2020 13:57
There isn't going to be, if PHP is in a loop using Ctrl-C does not trigger a catch or throw any type of error that could be caught. And you can't really use something like readline cause that would pause PHP waiting for input.
May 29, 2020 13:50
Well that is a very common practice to be sure .... so is that line just looking for a Ctrl-C ??
May 29, 2020 13:46
Then please edit your code to include a Minimal, Complete, and Verifiable example, as explained in stackoverflow.com's help center so others may better assist. What you have in the question now isn't something anyone could replicate and test with.
May 29, 2020 13:46
What is except KeyboardInterrupt: pass in Python? You've tagged this for PHP but assume everyone knows what that statement does. What is the code in the try portion of the block?
May 29, 2020 13:46
Then it isn't clear what you are trying to catch. Normally a try/catch block is used around a very specific "thing" that you want to make sure either works or doesn't.
May 29, 2020 13:46
If you do a print_r or var_dump of $e you should see what the code is. The codes that may be returned depend on where the exception is being thrown from (PDO etc).
 
Apr 21, 2020 15:15
You are welcome
Apr 21, 2020 15:15
It's your code
Apr 21, 2020 15:13
Well I think you made it worse :)
Apr 21, 2020 15:13
Regardless, I'm glad you got it working the way you wanted/need it to.
Apr 21, 2020 15:13
So you want a PDF for each image? That's different than what your question was.
Apr 21, 2020 15:12
OK but you only need the one function .... to actually add the page and image ... but glad to hear that you got it working
Apr 21, 2020 15:11
It sounds like you are not understanding the process of creating a PDF. Unless you make a function like that accept an arbitrary number of images but, even then, you would still have to loop through the images in your function.
Apr 21, 2020 15:10
That's it exactly .... I'm in the midst of a project where I do something very similar ... and I created a function to loop through the possible images that might be available to be included .... it gets call for all 5000+ PDFs being generated
Apr 21, 2020 15:05
Why is that a bad thing? It could be considered the normal way of doing things. When you have a repeat a sequence of commands over and over you put them into a function of some sort instead of repeating them over and over. By your very definition of what you are trying to do having your mail script call the routine to add images is the only proper way to do it.
Apr 21, 2020 14:50
As I explained, create the PDF and do the output in your main script NOT in this routine. Simply move the creation and output to your main script. Call the creation before the loop through the images and call the output after all of the images have been added.
Apr 21, 2020 14:49
As written it is going to create a new PDF every time it is called, add the image then output the PDF.
Apr 21, 2020 14:49
Remove the creation of the PDF and the output and simply call append_image_to_pdf in the main script for each image to be added. The creation of the PDF and eventual output should be done once in the mail script.
Apr 21, 2020 14:49
Was there a question in there?
 

SO Close Vote Reviewers

This room is for support and discussion about reviewing and co...
Mar 1, 2020 15:24
@Dharman Thanks, I had flagged it as spam too, was just trying to expedite it's removal. Won't send another here. Sorry.
Nov 25, 2019 17:58
Y'all be right, the subtle difference is in the lower right side where it shows vote instead of flag. Learned my something for today.
Nov 25, 2019 17:54
@Kulfy It didn't. All the way through it said flagging.
@JohnDvorak you're probably right though the dialog doesn't change. :)
Nov 25, 2019 17:53
@JohnDvorak are you sure John? I just tried to flag to close on a post and it looks like it worked.
 
Feb 18, 2020 18:01
I'm not even sure that's really NSFW as it doesn't show anything at all.