Search found 176 matches

by rhecker
Sun Sep 28, 2014 10:12 am
Forum: Databases
Topic: LEFT JOIN returning duplicate rows
Replies: 2
Views: 5364

Re: LEFT JOIN returning duplicate rows

This question was answered on the SitePoint forum. Requinix, thanks much for your contribution. If anyone is curious, this is the revised query that solves the issue: $sql=$dbh->prepare("SELECT A.student_id , A.invoice_date , A.invoice_set , A.last_name , A.first_name , A.addon_last_name , A.ad...
by rhecker
Sat Sep 27, 2014 6:08 pm
Forum: Databases
Topic: LEFT JOIN returning duplicate rows
Replies: 2
Views: 5364

LEFT JOIN returning duplicate rows

This is a query that returns the students registered for a course, and identifies those who are marked as "arrived" based on their accommodation (room at the retreat). However, some students may have more than one accommodation (because they are going to move from one room to another durin...
by rhecker
Sat Jun 07, 2014 5:13 am
Forum: PHP - Code
Topic: loop not processing first element
Replies: 3
Views: 931

Re: loop not processing first element

Thank you for catching the single equality. I have only tested with English so far, so that issue had not shown up. Because I am treating a sequence of numbers as a string, using strict equality actually never returns a positive, but I was unaware of this point regarding strpos(), so thank you for t...
by rhecker
Fri Jun 06, 2014 9:41 pm
Forum: PHP - Code
Topic: loop not processing first element
Replies: 3
Views: 931

loop not processing first element

My code is intended to display selected days of the week in a variety of languages, with the week starting on Monday. Because November 2014 starts on a Monday, I use it to define the days, so 246 parsed should be Tuesday Thursday Saturday. The problem is that my code is dropping the first day of the...
by rhecker
Fri Mar 28, 2014 5:39 pm
Forum: PHP - Code
Topic: International days of week, non-specific date
Replies: 6
Views: 1498

Re: International days of week, non-specific date

OK, but that wasn't the question. I wasn't asking to solve a performance issue.

It's OK if no one has a better solution than what I came up with myself. I just wondered if there was a better solution out there than the one I had already thought of.
by rhecker
Thu Mar 27, 2014 5:07 pm
Forum: PHP - Code
Topic: International days of week, non-specific date
Replies: 6
Views: 1498

Re: International days of week, non-specific date

Christopher, that's the solution I already described. (your paragraph 1). Your suggestion in paragraph 2 wouldn't work because it requires that I create the array for each language.
by rhecker
Thu Mar 27, 2014 4:35 pm
Forum: PHP - Code
Topic: International days of week, non-specific date
Replies: 6
Views: 1498

Re: International days of week, non-specific date

. . .and if you wanted to switch language you'd have to alter the code anyways. No, the whole idea is for my clients to be able to add as many languages to their sites as they need, without my involvement. This is the beauty of the IntDateFormatter class (and to a lesser degree, set_locale). It onl...
by rhecker
Thu Mar 27, 2014 12:59 pm
Forum: PHP - Code
Topic: International days of week, non-specific date
Replies: 6
Views: 1498

International days of week, non-specific date

I am using the IntlDateFormatter class with the PHP DateTime class to format dates in different languages. It's great for specific dates. For example, the following returns the Vietnamese for the day of the week: $date = new DateTime(); $formatter = new IntlDateFormatter('vi', IntlDateFormatter::LON...
by rhecker
Mon Nov 25, 2013 9:56 pm
Forum: Databases
Topic: MySQL event not working
Replies: 7
Views: 6780

Re: MySQL event not working

No one here knows how to write a simple MySQL event script?

I understand the value of retaining data and simply changing a field value to something like "deleted". It doesn't change my fundamental question.
by rhecker
Wed Nov 13, 2013 6:28 pm
Forum: Databases
Topic: MySQL event not working
Replies: 7
Views: 6780

Re: MySQL event not working

Thanks, but that wasn't an answer to my question.

Anyone else?
by rhecker
Wed Nov 13, 2013 10:16 am
Forum: Databases
Topic: MySQL event not working
Replies: 7
Views: 6780

MySQL event not working

I am trying to create an event in MySQL that runs once per hour and will delete records that have a timestamp of at least an hour older than the current time minus two hours; however, the script I have written does not accomplish this. The idea is to purge invoice transactions that have not complete...
by rhecker
Mon Nov 04, 2013 9:48 am
Forum: PHP - Code
Topic: Create dynamic pages[NOT SOLVED]
Replies: 4
Views: 1731

Re: Create dynamic pages[NOT SOLVED]

switch ($_GET['command']){ case 'showProfile': include('profile.php'); break; case 'saveSettings': include('savesettings.php'); break; } I used include files in the example above, but it could also be a query, a variable, or whatever, and any combination thereof. . . .and sometimes it makes sense t...
by rhecker
Sat Nov 02, 2013 11:07 am
Forum: PHP - Code
Topic: Printing receipts to thermal printer
Replies: 0
Views: 1601

Printing receipts to thermal printer

I need to be able to print receipts from my self-made shopping cart to an Epson T20 thermal printer. Nothing fancy. Don't need to control cash drawer or anything else. Just print the receipt text and cut the paper. I have so far failed to get php_printer properly installed on my Win7 PHP 5.4.16 deve...
by rhecker
Wed Aug 14, 2013 8:25 pm
Forum: Databases
Topic: Lost error reporting after server upgrade
Replies: 2
Views: 4329

Re: Lost error reporting after server upgrade

Good now. Thanks.
by rhecker
Wed Aug 14, 2013 12:10 pm
Forum: Databases
Topic: Lost error reporting after server upgrade
Replies: 2
Views: 4329

Lost error reporting after server upgrade

On my development server (not the live server) I want to see mySQL errors on the page and this is what I had before I upgraded to ZEND server 6.1.0. (which also upgraded MySQL to 5.5) But now they are not showing. My DB connection script includes the following: $dbh->setAttribute(PDO::ATTR_ERRMODE, ...