944,196 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Unsolved
  • Views: 4354
  • MySQL RSS
Apr 16th, 2005
0

What is wrong with my My SQL query

Expand Post »
Hey folks, I need your help. I stuck with my Database project.
I have five tables on the database: These are

Room, Guest, Booking, Employee and Admin

Room (room_ no, room_ type, price)
Guest (guest_ no, Fname, Sname, address,…)
Booking (room_no, guest_no, Fname, Sname, arrival_date,
departure_date, emp_no, user_name, password)
Employee (emp_no, Fname, Sname, uaser_name, password)
Admin (admin_no, fname, Lname, user_name, password)

I used the fallowing query to search for available rooms:

Select *
From Room R
Where R.room_no
NOT IN (Select B.room_no
From R.room_no = B.room_no
And R.room_type = ‘single’
And B.arrival_date = ‘2005-03-16’
And Bdeparture_date = ‘2005-04-19’

Q1. Whenever I do a query on localhost it retrieves a value, but when I try on live it shows an error. Please, tell me what the problem in this query could be?

Q2. Does MySQL use different SQL query such as like PL SQL or is it the similar query?

Q3.Is their any simple query than this.

Thanks for all your help.

DSG
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dsgnews is offline Offline
8 posts
since Apr 2005
Apr 17th, 2005
0

Re: What is wrong with my My SQL query

Quote ...
Whenever I do a query on localhost it retrieves a value, but when I try on live it shows an error
Windows doesn't care about capital letters. Linux/Unix does.




Michael
Reputation Points: 11
Solved Threads: 8
Posting Whiz in Training
pcschrottie is offline Offline
204 posts
since Dec 2004
Apr 17th, 2005
0

Re: Please help me out with MySQL query

well if it works on localhost, then the code is fine. There's probably a problem with the server you're trying to connect to. What error do you get?
Reputation Points: 92
Solved Threads: 51
Practically a Posting Shark
Phaelax is offline Offline
856 posts
since Mar 2004
Apr 19th, 2005
0

Re: What is wrong with my My SQL query

THIS WAS THE ERROR CODE:

#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.roo
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dsgnews is offline Offline
8 posts
since Apr 2005
Apr 19th, 2005
0

Re: Please help me out with MySQL query

Are you using a scripting language to send the query? Like php or asp? If so you will need to post the code you are using to submit the query.
Reputation Points: 17
Solved Threads: 14
Posting Whiz
DanceInstructor is offline Offline
355 posts
since Feb 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: Is MySQL available for use as a local database?
Next Thread in MySQL Forum Timeline: URGENT: UBBThreads MySQL database merge





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC