coldfusion translation?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
kaiyne
Forum Newbie
Posts: 2
Joined: Fri May 02, 2008 8:26 am

coldfusion translation?

Post by kaiyne »

I'm in the process of changing our site from coldfusion using access to php with mysql and I'm having some trouble, go figure!
What I'm trying to accomplish is a query to the db that returns a field that contains a ulr while displaying the text from another field, all inside a menu table.
To start, my db has 4 fields:
MenuID, MenuCategory, MenuItem, URL
6 1 Make an inquery /inquiries/
6 2 Schedule a Tour /inquiries/schedule/
6 4 Apply Now /inquiries/apply/
6 3 Send to a Friend /inquiries/friend/

this is some of my coldfusion code:

Code: Select all

<td align="left" valign="top"><cfoutput query="menu">
                  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="menutable">
                    <tr>
                      <td><a href="#menu.URL#" class="menu">#menu.MenuItem#</a></td>
                    </tr>
                  </table>
                </cfoutput></td>
 
This is what the links look like on the page:
Image

I haven't had any other problems with php, I can connect to the db and perform queries and have figured out a lot so far, but this has been a bit of a hurdle and I'm not even sure if it can be done.

Thanks!
kaiyne
Forum Newbie
Posts: 2
Joined: Fri May 02, 2008 8:26 am

Re: coldfusion translation?

Post by kaiyne »

Ok, maybe another question; Can this actually be done? If so, I'll keep messing with the code until something works, or if not, please tell me so I'm not wasting my stress molecules.
User avatar
rlg0613
Forum Newbie
Posts: 12
Joined: Sat Aug 25, 2007 10:15 am

Re: coldfusion translation?

Post by rlg0613 »

I'm also working on a ColdFusion translation. I was looking for some help in another area when I saw your post.

Let me say this up front - I'm not a ColdFusion programmer. However looking at your code snippet, it looks like the previous DB had at least the following 2 fields in it: URL and MenuItem. If your MySQL DB also has those 2 fields then after executing the appropriate SELECT you would loop through the results and form the HTML link from the similar 2 fields. The URL field would actually contain the full or relative link and the MenuItem field would provide the text as shown in the image you provided. Or where you asking something else??
Post Reply