DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Database Design (http://www.daniweb.com/forums/forum142.html)
-   -   Problem with MySQL Query (http://www.daniweb.com/forums/thread22105.html)

dsgnews Apr 18th, 2005 3:32 pm
Problem with MySQL Query
 
Hi Friends, I need your help.
Whenever I do a query on localhost it retrieves a value, but when I try on live it shows an error? What could be the problem?

nicentral Apr 18th, 2005 4:18 pm
Re: Problem with MySQL Query
 
What do you mean by live?

dsgnews Apr 18th, 2005 4:29 pm
Re: Problem with MySQL Query
 
live I mean server

nicentral Apr 18th, 2005 6:49 pm
Re: Problem with MySQL Query
 
Ok, tell me if I am correct here. WHen you query the database from the local server, you get results, but when you query it from a remote server you get an error. Is this correct?

dsgnews Apr 19th, 2005 3:16 pm
Re: Problem with MySQL Query
 
The error is as follows:

SELECT *
FROM room
WHERE room_no NOT
IN (
SELECT R.room_no
FROM room R, Booking B
WHERE R.room_no = B.room_no AND R.room_type = 'single' AND
B.arrival_date = '2005-03-16' AND B.departure_date = '2005-03-19'
)

LIMIT 0 , 30

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near
'SELECT R.room_no
FROM room R, Booking B
WHERE R.room_no = B.room

nicentral Apr 19th, 2005 9:39 pm
Re: Problem with MySQL Query
 
without knowing the schema, the only suggestion I can give you is to try the subquery on its own. If this doesn't work, then you have an issue with your subquery. Try the select subquery withtout the where clause. Basically, break the query down into manageable steps.

Andy

jwshepherd Jun 16th, 2005 12:21 pm
Re: Problem with MySQL Query
 
make sure your database connection string is for remote access and not limited to local.

izzi Aug 5th, 2008 12:02 am
Re: Problem with MySQL Query
 
How to maximaize the execution of mysql, coz i use a very large database. everytime i do query always comes up with maximum execution of 60 seconds elapse.., cant stand of that. is ther some way ??


All times are GMT -4. The time now is 6:11 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC