Re: Making several variables into 1 variable
| From: | Miller, Terion | Date: | Tue, 28 Jul 2009 14:40:05 +0000 |
| Subject: | Re: Making several variables into 1 variable | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-295936@lists.php.net to get a copy of this message | ||
<,snip>
>
You can also do this right within MySQL without needing to create a
variable. This should work:
$sql = "SELECT DISTINCT restaurants.ID, name, address, inDate FROM
restaurants, inspections WHERE restaurants.name != '' AND
datediff(curdate(),inspections.inDate)>=30 GROUP BY restaurants.ID
ORDER BY 'name' ";
Take care,
Floyd
Ok I have to do the same thing again but with even more variables posted from a form
I have a form where a user can choose a date range currently the form returns 6 variables (bmonth,
bday, byear, emonth, eday, eyear) now I have to take those and get them all formatted together (well
the bmonth, bday, byear together) in the mm/dd/yy format
Wait can't I.....
$month = $date(m, $bmonth) like that but then I still end up with 3
$month, $day, $year.... Does that work like that $date(m/d/y, $month, $day, $year)