Reputation: 241 Stalwart
- Active Members
- Active Posts:
- 698 (0.34 per day)
- 24-November 08
- Profile Views:
- Last Active:
- Jul 28 2014 04:39 AM
- OS Preference:
- Favorite Browser:
- Favorite Processor:
- Favorite Gaming Platform:
- Your Car:
- Who Cares
- Dream Kudos:
Posts I've Made
Posted 18 Jul 2014A quick one, going for the symbolism.
Edit: Added username
Posted 31 May 2014That doesn't really look like MYSQL queries..
Yeah sorry I should have posted it just in query format rather than zends format.
The problem that I was having was it took into account two dates, which were far apart. Let's say it was a database for a movie theatre, and Captain Americas first showing was on the 10th of March, and last showing was on the 29th of May, and those were the only two dates you have in the database. You know it's going to be showing at regular intervals between those dates but you don't have the specific dates and times.
So if someone was on the website, and they clicked "what's showing in April" , Captain America should be on the list, but neither of the dates are in April. I tried using a between query originally and failed, but I've managed to get it to do what I want this time.
My solved query (feel free to nitpick it or recommend improvements):
//added hardcoded dates for example SELECT * FROM `shows` WHERE `showingfrom` BETWEEN '2014-05-01' AND '2014-05-31' OR `showingto` BETWEEN '2014-05-01' AND '2014-05-31' OR `showingfrom` < '2014-05-01' AND `showingto` > '2014-05-31'
and for anyone interested in the Zend query:
<?php //in this query I added a greater than today for end date, just incase they are trying to load this months and somethings already finished $select->from('shows'); $select->where ->between('showingfrom', $start, $end)->and->greaterThan('showingto', $today) ->or ->between('showingto', $start, $end)->and->greaterThan('showingto', $today) ->or ->lessThan('showingfrom', $start)->and->greaterThan('showingto', $end)->and->greaterThan('showingto', $today); ?>
Posted 22 May 2014I carry on with my life.
Posted 7 May 2014Attempted a couple of modern movie quotes but just couldn't seem to get them to sit right, so I've gone for a classic instead.
Posted 26 Apr 2014When you say it's not working, do you mean that it is throwing an exception? an error? Or just redirecting you back to the signup page with no session being set?
If it's an error, then posting it here would help.
If you are being redirected back to the signup page then it's because the count is returning zero which means a problem with your details or within the query / fetch.
- Member Title:
- sudo pacman -S moneyz
- 24 years old
- November 6, 1989
- web design and development