Welcome to Dream.In.Code
Become an Expert!

Join 149,858 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,340 people online right now. Registration is fast and FREE... Join Now!




If statements

 
Reply to this topicStart new topic

If statements

wendy_w
8 Aug, 2005 - 10:49 AM
Post #1

New D.I.C Head
*

Joined: 2 Jun, 2005
Posts: 25


My Contributions
Hi everyone, I've been lurking for awhile now and I need some help. I am trying to write a program that will allow someone to search for reports that are in a mysql db. I want to be able to create a page where if you do 'this' then you will go to 'this page'.. if you do 'that' you will go to 'that page'...

I know I need to use if statements to make it work right but I am just having trouble creating the code that I can use to make it work.

Am I making any sense?
User is offlineProfile CardPM
+Quote Post

skyhawk133
RE: If Statements
8 Aug, 2005 - 11:01 AM
Post #2

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 15,267



Thanked: 61 times
Dream Kudos: 1650
Expert In: Web Development

My Contributions
Can you give me a little better idea of what 'this' and 'that' are?

I'm personally a fan of having a variable that will load a template from the index page, something like this:

CODE

<cfparam name="url.page" default="home">

<cfinclude template="#url.page#.cfm">


That will allow you to do something like index.cfm?page=this and it will load this.cfm in to your index.cfm file (which would probably be a template or have some other code that must load on every page.

Now, if you're talking more from a search standpoint, give me some more details and I can guide you through how to do a good search page using if statements and WHERE clauses for your database.

And, as a side note, thanks for registering! You lurkers scare me smile.gif better to know who's watching us wink2.gif
User is online!Profile CardPM
+Quote Post

wendy_w
RE: If Statements
9 Aug, 2005 - 08:32 AM
Post #3

New D.I.C Head
*

Joined: 2 Jun, 2005
Posts: 25


My Contributions
I am trying to create a page that will do a drill down of sorts... I want to include a header and footer that have already been created.


in between those I want to have a page that will ask what you are searching for and you click a radio button and after that it takes you to that radio buttons page so that you can further define your search.

but all the while still being in the same cfm page.
User is offlineProfile CardPM
+Quote Post

skyhawk133
RE: If Statements
9 Aug, 2005 - 08:48 AM
Post #4

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 15,267



Thanked: 61 times
Dream Kudos: 1650
Expert In: Web Development

My Contributions
I would suggest creating a index.cfm page. Then have a header.cfm and a footer.cfm, use the <cfinclude template="header.cfm"> to include the header, and similarly with the footer.

Can you create your drill down form so I can have some real field names and such to work with. Basically, as you drill down, you're going to re-query, and concatenate the WHERE clause with additional AND something = "#variable#".

Give me a better idea of what you're drilling down through, show me your HTML form you want to use and the output you want to get, and hopefully we can put the middle pieces together smile.gif
User is online!Profile CardPM
+Quote Post

wendy_w
RE: If Statements
16 Aug, 2005 - 07:11 AM
Post #5

New D.I.C Head
*

Joined: 2 Jun, 2005
Posts: 25


My Contributions
Well I ended up figuring out most of what I needed to. But one question. I have to join two tables - one is NAMELIST and it has the fname and lname and speccode that I need. I need to join it to another table, programplan, that has the speccode and programtitle. Is there a way to join them so that I can display the fname and lname in a dropdown box so that someone can choose a fullname vs. the dropdown with fname and the dropdown with lname?
User is offlineProfile CardPM
+Quote Post

skyhawk133
RE: If Statements
16 Aug, 2005 - 07:17 AM
Post #6

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 15,267



Thanked: 61 times
Dream Kudos: 1650
Expert In: Web Development

My Contributions
Hmmm, I'm not sure I follow what you're trying to do, do you need the SQL query to join the tables? or are you looking for a programmatic solution in ColdFusion
User is online!Profile CardPM
+Quote Post

wendy_w
RE: If Statements
16 Aug, 2005 - 12:35 PM
Post #7

New D.I.C Head
*

Joined: 2 Jun, 2005
Posts: 25


My Contributions
tongue.gif once again I figured it out. needed concat...
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 10:34AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month