0
Total Noob wanting some help
New Here
,
/t5/coldfusion-discussions/total-noob-wanting-some-help/td-p/950078
Apr 24, 2008
Apr 24, 2008
Copy link to clipboard
Copied
Hi guys I just got new job and they use CF over here. My
first small project is thowing me for a loop just because I've
never really worked databases before. I'm looking for some starting
help. We have this intranet site that everyone here uses to place
orders and stuff, they all use bunches of databases. And what my
boss is wanting me to do is find a way to put a count of all the
items in a database that match a certian criteria on the main page.
So what I need is a way to count database items. Help would be
helpful. Like I said I'm a total n00b and forgive me if you can't
make heads or tails of this. I'd be glad to explain more in depth
for help. Thanks guys
Kevin
Kevin
TOPICS
Getting started
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Advocate
,
/t5/coldfusion-discussions/total-noob-wanting-some-help/m-p/950079#M86927
Apr 25, 2008
Apr 25, 2008
Copy link to clipboard
Copied
Well, let says that you want to get a count of everything in
your ITEMS table that has a QUANTITY of at least 3 and a PRICE of
greater than $5.00 (assuming that QUANTITY and PRICE and columns
within the ITEM table)
A real simple way of handling this app would be to first do the query and then out put the result. Your entire application would be:
<cfquery name="qGetItemCount" datasource="datasourceName">
SELECT Count(*) AS itemCount
FROM items
WHERE quantity >= 3
AND price > 5
</cfquery>
<cfoutput>#qGetItemCount.itemCount#</cfoutput>
And that is it. It only gets more complicated from there, and you need to strongly consider some learning resources if you want to excel at ColdFusion. It is an easy language to learn and use, but, like any other language, it should not be fuddled through.
Note: You'll need to get your datasourceName from your administrator.
A real simple way of handling this app would be to first do the query and then out put the result. Your entire application would be:
<cfquery name="qGetItemCount" datasource="datasourceName">
SELECT Count(*) AS itemCount
FROM items
WHERE quantity >= 3
AND price > 5
</cfquery>
<cfoutput>#qGetItemCount.itemCount#</cfoutput>
And that is it. It only gets more complicated from there, and you need to strongly consider some learning resources if you want to excel at ColdFusion. It is an easy language to learn and use, but, like any other language, it should not be fuddled through.
Note: You'll need to get your datasourceName from your administrator.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Valorous Hero
,
LATEST
/t5/coldfusion-discussions/total-noob-wanting-some-help/m-p/950080#M86928
Apr 25, 2008
Apr 25, 2008
Copy link to clipboard
Copied
In addition, if you will be working with databases you will
need to learn SQL. SQL is separate from ColdFusion. It is the
language used to communicate with databases, regardless of what web
application you are using. There are some syntax differences,
depending on which database type you are using. However, the basic
language structure is the same across most databases.
You can find a good introductory SQL tutorial here
http://www.w3schools.com/sql/default.asp
You can find a good introductory SQL tutorial here
http://www.w3schools.com/sql/default.asp
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

