Current location: Hot Scripts Forums » Programming Languages » PHP » SQL Help Meeeee


SQL Help Meeeee

Reply
  #1 (permalink)  
Old 10-04-03, 02:31 PM
alirezaok alirezaok is offline
Newbie Coder
 
Join Date: Oct 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
SQL Help Meeeee

hello

this:

$Query = 'SELECT * '
. ' FROM `datas` '
. ' WHERE 1 AND `date` >= '2003-08-07' && `date` <= '2003-08-09' LIMIT 0, 30';
>>>>>>WORKS

but this:

$jsdate=2003-08-07;
$jedate=2003-08-09;
$Query = 'SELECT * '
. ' FROM `datas` '
. ' WHERE 1 AND `date` >= '$jsdate' && `date` <= '$jedate' LIMIT 0, 30';
>>>>>>Not Works

Whyyyy?
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 10-04-03, 02:40 PM
YourPHPPro's Avatar
YourPHPPro YourPHPPro is offline
Community VIP
 
Join Date: Aug 2003
Posts: 430
Thanks: 0
Thanked 0 Times in 0 Posts
After

PHP Code:

$Query 'SELECT * '

' FROM `datas` '
' WHERE 1 AND `date` >= '$jsdate' && `date` <= '$jedate' LIMIT 0, 30'
put

PHP Code:

print $Query
and I'm sure it would be obvious what is going on...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 10-04-03, 02:57 PM
Chroder Chroder is offline
Newbie Coder
 
Join Date: Sep 2003
Location: Toronto, Ontario
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
You've got your stirngs screwed up a little bit. Try this

PHP Code:

 $Query 'SELECT * '

' FROM `datas` '
' WHERE 1 AND `date` >= '.$jsdate.' && `date` <= '.$jedate.' LIMIT 0, 30'
Hence the dot operator by the variable $jsdate.
__________________
DevBox.net | DevBoxForums.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 10-04-03, 03:00 PM
YourPHPPro's Avatar
YourPHPPro YourPHPPro is offline
Community VIP
 
Join Date: Aug 2003
Posts: 430
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Chroder
You've got your stirngs screwed up a little bit.
Is this also correct from your previous post ?

PHP Code:

$jsdate=2003-08-07;

$jedate=2003-08-09
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 10-04-03, 03:21 PM
alirezaok alirezaok is offline
Newbie Coder
 
Join Date: Oct 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
thanks of all

my problem slove with it:

$Query = "select * from datas where 1 and date >= '$jsdate' AND date <= '$jedate' LIMIT 0, 30";

good luck
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
Update SQL alirezaok PHP 1 10-07-03 04:09 AM
ASP Calendar..HELP...pls jimthepict ASP 1 07-31-03 06:01 PM
change my field in this example sal21 ASP 3 07-14-03 03:49 AM
Web Interface for SQL Server 2000 Greg Database 2 06-16-03 10:00 AM
Windows 2000 Hosting with ASP.NET & MS SQL - $6.99/mo JodoHost General Advertisements 0 06-15-03 11:08 AM


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