[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Problem in cfoutput as CSS like

Posted on 2004-10-26
2
Medium Priority
?
377 Views
Last Modified: 2013-12-24
hi guys....hope u dont mind helping me again.

first table..css1.tbl

columns (4)
-----------------------------------------------------------------------
id(primary) | elements | opencurlybracket | closedcurlybracket
-----------------------------------------------------------------------
100 | a | { | }
101 | b | { | }
102 | td | { | }
103 | input | { | }
103 | .class | { | }

in my 2nd table..css2.tbl

columns()
id(foreign) | tag | colon | properties | semicolon
---------------------------------------------------------------
100 | color | : | blue | ;
100 | font-style | : | normal | ;
100 | font-size | : | 12px | ;
100 | font-family | arial | ;
101 | color | : | blue | ;
101 | font-style | : | normal | ;
101 | font-size | : | 12px | ;
101 | font-family | arial | ;
102 | color | : | blue | ;
102 | font-style | : | normal | ;
102 | font-size | : | 12px | ;
102 | font-family | arial | ;

of course 101 stands for a, 101 for b, 102 for td......and the rest

my query..

<cfquery name="table2">
select * from css2
</cfquery>

// i outputed table2 and at the same time i query table1

<cfoutput query="table2">
   <cfquery name="table1">
   select * from css1
  where id = '#table2.id#'
   </cfquery>

#table1.elements##table2.opencurlybracket# #table2.tag# #table2.colon# #table2.properties# #table2.semicolon##table2.closedcurlybracket#

</cfoutput>

it gives me this output

a {color:blue;}
a {font-style:normal; }
a {font-size:12px;}
a {font-family:arial;}
b {color:blue;}
b {font-style:normal; }
b {font-size:12px;}
b {font-family:arial;}
td {color:blue;}
td {font-style:normal; }
td {font-size:12px;}
td {font-family:arial;}

well how can i output something like this, CSS..

a {color:blue;
font-style:normal;
font-size:12px;
font-family:arial;}

b{color:blue;
font-style:normal;
font-size:12px;
font-family:arial;}

td {color:blue;
font-style:normal;
font-size:12px;
font-family:arial;}

if i got this output then i can save it as css file(sample.css)

i guess u can solve this pls......... i got no problem editing and inserting all properties in tables..only outputing.
0
Comment
Question by:fourth_noel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 14

Accepted Solution

by:
Renante Entera earned 500 total points
ID: 12419327
Hello fourth_noel!

You can have your code like this :

<cfquery name="GetCSS1" datasource="#AppDataBase#">
SELECT * FROM css1
</cfquery>

<cfloop query="GetCSS1">
  <cfset css1ID = id>
  <cfquery name="GetCSS2" datasource="#AppDataBase#">
    SELECT * FROM css2
    WHERE id = #css1ID#
  </cfquery>
  <cfoutput>
    #elements##opencurlybracket#
    <cfloop query="GetCSS2">
      #tag##colon##properties##semicolon#
      <cfif currentrow neq recordcount>
        <br>
      </cfif>
    </cfloop>
    #closedcurlybracket#<br><br>
  </cfoutput>
</cfloop>

Hope this helps.  Just try it...


Goodluck!
eNTRANCE2002 :-)
0
 

Author Comment

by:fourth_noel
ID: 12419966
wow...that was great.....hehe... it was working exactly as i wanted....thank u very much eNTRANCE2002......!!!

c u again............!!
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question