Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
-
potato
- Forum Contributor
- Posts: 192
- Joined: Tue Mar 16, 2004 8:30 am
- Location: my lovely trailer, next to the big tree
Post
by potato »
Is it possible to make a query like:
SELECT * FROM agenda WHERE agenda_year = '2004' & agenda_month = '4' ORDER BY agenda_day ASC
With this code i get nothing. Somebody knows how to do it?
thnx
-
markl999
- DevNet Resident
- Posts: 1972
- Joined: Thu Oct 16, 2003 5:49 pm
- Location: Manchester (UK)
Post
by markl999 »
Try,
SELECT * FROM agenda WHERE agenda_year = '2004' AND agenda_month = '4' ORDER BY agenda_day
ASC is the default, so you don't need that.
-
potato
- Forum Contributor
- Posts: 192
- Joined: Tue Mar 16, 2004 8:30 am
- Location: my lovely trailer, next to the big tree
Post
by potato »
thanx, i found it just myself, but thanx for the help anyway
-
Pyrite
- Forum Regular
- Posts: 769
- Joined: Tue Sep 23, 2003 11:07 pm
- Location: The Republic of Texas
-
Contact:
Post
by Pyrite »
I think you either have to use AND or && (not just one &) .