Home
Username:
Password:
Macromedia ColdFusion Tutorials

The Cork Board / Special SQL [ ] commands




Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.


Learn More

Subtitles of the Movie

So here are the four set statements, then we get into the actual insert. Now you may have recalled me saying at an earlier time that they are a couple of reserved commands, reserved special words for SQL, such as level and desc for descending. In the past, I have used level as user_level and other versions of Access levels. And also desc, I have used as description, as a short form for the word description. Well those will give you problems if you try and use them without putting the square brackets around it. Same as date and time. So I am saying insert into the table message in these columns the following values, and we are sticking in subject_ID. It's a number, so you don't have to put quotes around it, the date and time - those are strings. If you look in here, in Access, this is how we set it up: subject_ID is a number, date, time, name, email and phone are all text, message is also a form of text. So date, time, name, email and phone all have to be in single quotes because they are text. The village_ID is a number, the message is another string, and the user_ID is a number, which we've set to be 2 if they haven't logged in. In the initial version of this application, no one will have logged in because we haven't allowed them to yet. And then we stick in the user_agent and the IP number as the browsers and the IP, which we set up here, the IP and the browser, and IP number and user_agent is what they are called in the database, and then approved. And approved is something that I have stuck in between the last 2, between the last movie and this one, because I forgot to talk about it. Initially, we are going to let everybody put their messages into the corkboard, but I am sure that at some point it's going to become a problem once the board becomes, the website becomes very popular. People start posting stuff in there that we don't want posted there. In which case if you haven't logged in, I am going to put an if around here that if client.user_ID is equal to 2, then this will be set to 0, approved will be set to 0. And when I get my email, which I will cover in a second, there will be a link down here just as we did with the links inserting - you know add you own to the links table. I will get an email, there will be link in here, I can click on it, it will bring be right to the back end where I can see the message and see whether or not its appropriate, and approve it right then and there. But for now, everyone will have their messages pre-approved. Just like a credit card, so after we insert it in there, we do cfmail statement. A new message has been added to the database, they will throw the email, the name, email, phone, the message itself, very important, then the user_ID, the browser and their IP number. User_ID, I am not going to know who it is, but I will see that it's just guest. And in fact because they will all be guest for now, I'll just take that out. And I will be able to see this. Then they will see 'thank you for adding your message', 'please click here to return to the corkboard', which we have seen right here. Please return to the corkboard. So we should see my test message, and there it is - the name, the mail, massages are working, the messages are working. The message, the message, the message, these are all my test messages. And there is no more link here, because the messages themselves are so short that they fall inside that and we asked the application to show, to not show a more link if it was less, if the message itself was less than 128. So I am going to go, I think at this point now, we should go back to the admin application that we setup, and create the edit corkboard entries. Because for now, we are done with the corkboard. We'll just leave it at this for now. Onto the next chapter - revisiting admin. are done with the corkboard. We'll just leave it at this for now. Onto the next chapter - revisiting admin.

Tutorial Information

Course: Macromedia ColdFusion
Author: Mike Muller
SKU: 33287
ISBN: 1930519656
Release Date: 2001-12-19
Duration: 8 hrs / 86 lessons
Work Files: Yes
Captions: For Online University members only
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 98,729 Video Tutorials (23,265 free)
  • Video Available as Flash or QuickTime
  • Over 1026 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available