Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-11-2012, 04:58 PM   PM User | #1
Hayezy
New Coder

 
Join Date: Nov 2011
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
Hayezy is an unknown quantity at this point
Macintosh Populate a dropdown with SQL Query

Hi All,

I'm in a bit of a sticky situation where I need some help with a bit of sql code, its not my forte.

I have 2 tables the first is recipients, which contains customer information, the second is appointments, which contains details of appointments that can be booked.

What I need to do is create an online booking form where if an appointment is booked, the booked appointment disappears from the drop down. A guy I've been chatting with on another forum said it might be possible using SQL, but he had no idea where to start either.

Could someone, anyone help me out by pointing me in the right direction?

Cheers
Hayezy is offline   Reply With Quote
Old 01-11-2012, 08:05 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,200
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
It would help if you had shown us your SCHEMA. That is, the names and types of at least the relevant fields in the two tables.

It would also help if you showed us your existing web server code. (PHP? ASP? JSP? Or???)

SQL can eliminate the already-used appointments from the records returned, but you still need to use web server code to convert the records to a <SELECT>.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Old 01-12-2012, 10:42 AM   PM User | #3
Hayezy
New Coder

 
Join Date: Nov 2011
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
Hayezy is an unknown quantity at this point
Quote:
Originally Posted by Old Pedant View Post
It would help if you had shown us your SCHEMA. That is, the names and types of at least the relevant fields in the two tables.

It would also help if you showed us your existing web server code. (PHP? ASP? JSP? Or???)

SQL can eliminate the already-used appointments from the records returned, but you still need to use web server code to convert the records to a <SELECT>.
Hi, no problem.

Recipient schema is below:

Title, Forename, Surname, client_urn, add1 - 6, postcode, tel, email, fc, fc_manager, appointment_id

Appointment schema is below:
appointment, appointment_date, appointment_time

I don't currently have any exisiting code for this campaign, and we'r integrating it with a marketing software called XMPie, most of the pages use C# script, but are saved as aspx pages (if this helps?)
Hayezy is offline   Reply With Quote
Old 01-17-2012, 04:49 PM   PM User | #4
Hayezy
New Coder

 
Join Date: Nov 2011
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
Hayezy is an unknown quantity at this point
Can anyone offer any assistance?
Hayezy is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:43 PM.


Advertisement
Log in to turn off these ads.