Current location: Hot Scripts Forums » Programming Languages » PHP » Question on sql query


Question on sql query

Reply
  #1 (permalink)  
Old 03-09-05, 07:03 PM
ajs ajs is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Question on sql query

I want to to have the code sort everything by name where all the dates match up, but the date is entered in the db like 5/01/05 and the code seems to gets stuck on the /, how do you get around that ?

Here's what I had

$query="SELECT * FROM title ORDER BY name WHERE date LIKE 5/%";
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 03-10-05, 05:27 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
you have to put them in quotes:
Code:
$query="SELECT * FROM title ORDER BY name WHERE date LIKE '5/%'";
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Query Sting Help ksroadrunner13 ASP 1 10-17-04 03:56 PM
SQL Syntax Question Daemon ASP 2 03-29-04 02:55 PM
Declared Functions skipper23 PHP 4 12-17-03 11:06 AM
index page not showing up skipper23 PHP 3 12-15-03 02:10 PM
change my field in this example sal21 ASP 3 07-14-03 03:49 AM


All times are GMT -5. The time now is 08:37 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.