Please help me out with MySQL query

Reply

Join Date: Apr 2005
Posts: 8
Reputation: dsgnews is an unknown quantity at this point 
Solved Threads: 0
dsgnews dsgnews is offline Offline
Newbie Poster

What is wrong with my My SQL query

 
0
  #1
Apr 16th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 204
Reputation: pcschrottie is an unknown quantity at this point 
Solved Threads: 8
pcschrottie's Avatar
pcschrottie pcschrottie is offline Offline
Posting Whiz in Training

Re: What is wrong with my My SQL query

 
0
  #2
Apr 17th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 763
Reputation: Phaelax is on a distinguished road 
Solved Threads: 38
Phaelax Phaelax is offline Offline
Master Poster

Re: Please help me out with MySQL query

 
0
  #3
Apr 17th, 2005
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?
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 8
Reputation: dsgnews is an unknown quantity at this point 
Solved Threads: 0
dsgnews dsgnews is offline Offline
Newbie Poster

Re: What is wrong with my My SQL query

 
0
  #4
Apr 19th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 355
Reputation: DanceInstructor is an unknown quantity at this point 
Solved Threads: 14
DanceInstructor's Avatar
DanceInstructor DanceInstructor is offline Offline
Posting Whiz

Re: Please help me out with MySQL query

 
0
  #5
Apr 19th, 2005
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.
Clear Mind Hosting and Web Design

If I've helped you please consider adding to my reputation.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC