If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Query works in test environment, but not live ? ? ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-14-05, 10:29
purpendicular purpendicular is offline
Registered User
 
Join Date: Mar 2004
Location: Rhode Island, USA
Posts: 55
Query works in test environment, but not live ? ? ?

I have a mirrored database on my machine, along with a mirrored website for my testing. I am running a query on my local machine that is working...
basicly just selecting to view a set of records if a value is Yes or No and between a date range selected by a user.
In my test environment the data is being filtered and fed to the user properly, but in the live environment I seem to only be pulling the information given by my assigned default values. The query doesn't seem to be pulling the values passed on by the form.
I had directly copied the pages over, so I can't see why it's not working.
Does it sound like there's something I'm missing here?
I'd appreciate any help.
Thanks, Ray
Reply With Quote
  #2 (permalink)  
Old 02-14-05, 11:58
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
what is the query? which database version is each server? is the data the same?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 02-14-05, 13:57
purpendicular purpendicular is offline
Registered User
 
Join Date: Mar 2004
Location: Rhode Island, USA
Posts: 55
It works now,
I'm pretty new at this and my sql was a bit off, but I still can't understand why it was constantly working in one environment and not the other.
Anyway, I got the sql straightened out and now it works fine in both live and test.
Another question, would there be a better way to do a date search than the way I've included in the attached pic? I seem to run into a snag when I want to search for a startdate of 2005-01-01 and 2005-01-31, it's not picking up the events on 2005-01-31 (probably because it's searching for 2005-01-31 00:00:00, right?)
I tried to search for >= 'qdate1' AND <= 'qdate2'
but I received an error.
Attached Images
File Type: jpg sql.JPG (48.2 KB, 30 views)

Last edited by purpendicular; 02-14-05 at 13:58. Reason: correct some type
Reply With Quote
  #4 (permalink)  
Old 02-14-05, 14:05
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
Quote:
Originally Posted by purpendicular
probably because it's searching for 2005-01-31 00:00:00, right?
right

change it to

... where foo >= 'qdate1' and foo < date_add('qdate2' , interval 1 day)
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 02-14-05, 14:27
purpendicular purpendicular is offline
Registered User
 
Join Date: Mar 2004
Location: Rhode Island, USA
Posts: 55
got it, cool, thanks a lot!!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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