PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old April 15th, 2003, 07:48 AM
fearx24 fearx24 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 9 fearx24 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
PHP SQL query, ORDER by date??

Using this code below for my query Im running, How would I order things by the 'date' I have.

PHP Code:
 mysql_select_db('CWD'); 
$query "SELECT * FROM records WHERE ".date." BETWEEN '.$thedate.' AND '.$thedate1.' AND 
"
.SessType." = 'number' OR ".SessType." = 'word'"


Thanks Nick

Reply With Quote
  #2  
Old April 15th, 2003, 08:10 AM
fearx24 fearx24 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 9 fearx24 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Re: PHP SQL query, ORDER by date??

Quote:
Originally posted by fearx24
Using this code below for my query Im running, How would I order things by the 'date' I have.

PHP Code:
 mysql_select_db('CWD'); 
$query "SELECT * FROM records WHERE ".date." BETWEEN '.$thedate.' AND '.$thedate1.' AND 
"
.SessType." = 'number' OR ".SessType." = 'word'"


Thanks Nick


I got it working now with this.

PHP Code:
 mysql_select_db('CWD'); 
$query "SELECT * FROM records WHERE ".date." BETWEEN '.$thedate.' AND '.$thedate1.' AND 
"
.SessType." = 'number' OR ".SessType." = 'word' 
ORDER BY "
.date." "

Reply With Quote
  #3  
Old April 15th, 2003, 04:18 PM
hadley hadley is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 63 hadley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Why are you putting your field names outside the string?

Shouldn't you just use -
$query = "SELECT * FROM records WHERE date BETWEEN '$thedate' AND '$thedate1' AND (SessType = 'number' OR SessType = 'word') ORDER BY date";
?

Hadley

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > PHP SQL query, ORDER by date??


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway