macromedia.coldfusion.getting_started
[Top] [All Lists]

Database questions / Help.

Subject: Database questions / Help.
From: "xstortionist"
Date: Wed, 27 Aug 2008 19:38:24 +0000 UTC
Newsgroups: macromedia.coldfusion.getting_started

Hi,
 I'm back once again with another newbie question for you elite coldfusion 
developers. Basically I'm in the works of creating a application that allows me 
to upload site news to a database and then output on our web site. Sounds easy 
enough right? Well I'm very new to CF and I'm still a beginner. here's my 
problem:

 http://mswebsol.com/testdb/news.cfm

 if you notice there is a weird box character being displayed and also alot of 
the text isn't being outputted. Why is this? I've been trying to find a 
solution for about an hour and still no luck.

 Help would be greatly appreciated. All I did was created a form which you can 
view here:

 http://mswebsol.com/testdb/news.cfm

 here's the code:







 FORM CODE
 <cfform name="sitenews" action="news_processing.cfm" method="post">
 Article Headline: 
 <cfinput name="headline" type="text" id="headline" size="55" />
 <br /><br />
 Article Copy: 
 <textarea name="newscopy" id="newscopy" cols="55" rows="20" ></textarea>
 <br /><br />
 <cfinput type="submit" name="Submit" id="Submit" value="submit" />
 </cfform>

 ------------------------------------------------------------------

 PROCESSING CODE
 <cfquery datasource="testdb">
        INSERT INTO news ( headline, newscopy )
     VALUES ( '#headline#', '#newscopy#' )
 </cfquery>

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
 <html xmlns="http://www.w3.org/1999/xhtml";>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 <title>Untitled Document</title>
 </head>

 <body>
 thank you for your submition
 </body>
 </html>

 ------------------------------------------------------------------

 OUTPUT CODE
 <cfquery name="GetArticle" datasource="testdb">
 SELECT *
 FROM
        news
 ORDER BY
        articlenumber DESC
 </cfquery>

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
 <html xmlns="http://www.w3.org/1999/xhtml";>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 <title>Untitled Document</title>
 <style type="text/css">
 <!--
 h1 {
        font: Arial, Helvetica, sans-serif;
        font-size: 18px;
        font-weight: bold;
        color: #0066CC;
        border-bottom: #0066CC solid 2px;
        margin: 0px 0px 0px 0px;
 }

 span {
        font: Arial, Helvetica, sans-serif;
        font-size: 12px;

 } 
 -->
 </style>
 </head>

 <body>
 <cfoutput query="GetArticle">
 <table width="700" border="0" cellspacing="0" cellpadding="0">
   <tr>
     <td nowrap="nowrap">
     <h1 class="style1">#headline#</h1>
     <span>#newscopy#</span>
     <p>
     </td>
   </tr>
 </table>
 </cfoutput>
 </body>
 </html>


<Prev in Thread] Current Thread [Next in Thread>