Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

total n00b question

Status
Not open for further replies.

mindouglas

IS-IT--Management
Mar 22, 2005
17
0
0
US
I "just" started learning CF. First question: Is there a list of all the tags used in MX7?

What I am trying to do is post a URL based on the date. So basically I am looking to post a URL from a db after quering for the date previous to the current. i.e. You would be reading an article and at the bottom would be a link to the previous day's article. I jsut want to know a good place to begin, start, learn, etc. I know some of the basics, I can create a mail form, etc. Sorry for the complete n00b question and thank you VERY much for any assistance
 
Hi,

Macromedia keeps a great documentation system at

you can select your CF version, then "CFML reference" and then "Coldfusion Tags" to get a complete list of tags.

There are a lot of other options along the way that can give you a lot of information so I didn't link you directly to CF7 tags list.

Between that documentation and this forum there is nothing you can't do.



Travis Hawkins
BeachBum Software
travis@cfm2asp.com
 
depending on how comfortable you are with livedocs you can also get a book. livedocs is natoriously not very user friendly, even the new version isn't super.

i go oreilly hands down.
here is an MX book. mx 7 is still pretty new and you wont find much on it yet.


you can use livedocs "what's new in MX7" section to tie everything together.

If you don't ask the right questions, you don't get the right answers. A question asked in the right way often points to its own answer. Asking questions is the ABC of diagnosis. Only the inquiring mind solves problems.

-Quote by Edward Hodnett
 
I figured that all out, now I am trying to come up with the right query to display a certain column from the table. I'm using an MS SQL db and an id column with an int data type giving it an autonumber (like in access) but I can't figure out how to query the the column with the highest id value, if that makes sense. This is my first CF project and ontop my first db driven web project. I'm trying to add a feature that would allow some buddies and I to post articles on a site we designed (which was our first web design project ;) Thansk a lot for any help!

I have a QUE MX book next to me now, its helped a lot.
 
Something like this probably.

select top 1 from MyTable order by ID desc

That should return 1 record off the top and since we sorted by ID descending the highest one will be at the top.

I don't know what you're using that for, but don't use it to find the most recently inserted ID... it will work a couple of times and then two people will insert about the same time and it will all get messed up.

Travis Hawkins
BeachBum Software
travis@cfm2asp.com
 
I got the right statement to disaply the most recent, but when I try to disaply all in a descending order I get a syntax error. This is the statement I am using:

SELECT TOP 1
FROM articles
ORDER BY id DESC

Error=" Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near the keyword 'FROM'."

Weird ... any thoughts, thanks a lot!

I used this to specify the most recent article:

SELECT id, articletext, artcldate, artclauthor, artclname
FROM articles
WHERE id=(SELECT MAX(id) FROM articles)

 
nm ... figured it out:

SELECT id, articletext, artcldate, artclauthor, artclname
FROM articles
ORDER BY id DESC

lol ... duh

anyway, is there a way that cfoutput can put this in a nice table? here is the link btw:
Thanks again!
 
i take it the values that are there are hard coded?

it's pretty simple, in this case you don't need to loop since you only have one (right?)

you start with the cfoutput tags. there are a couple ways you can do it, one set of cfoutput around everything or just around the cf variables. i'm goign to just do it around the variables to avoid problems with the hex color values.

Code:
<font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="-6">
<table align="center">
	<tr>
		<td bgcolor="#CCCCCC"><strong>Article:</strong>[b]<cfoutput>#queryName.articletext#</cfoutput>[/b]</td>
	</tr>
</table>
</font>
...
...
rest of your html...
...

If you don't ask the right questions, you don't get the right answers. A question asked in the right way often points to its own answer. Asking questions is the ABC of diagnosis. Only the inquiring mind solves problems.

-Quote by Edward Hodnett
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top