Skip to main content

Posts

Showing posts with the label ColdFusion

Sleepy Day

Today feels like a sleepy day, I don't know why that is. It just feels that way. I wish I could figure out why life happens the way it does. But I don't understand how anything goes about in this life. If I could understand one thought in life...I think I'd like it to be able to grasp why we are here on this Earth. Is it because the aliens want us to become something better than we are? I mean they're the ones in charge right? I think they are.

ColdFusion

So recently, I decided to include ColdFusion in my Linux setup. I was going to just run Tomcat and install CF that way, but well I decided against that route and installed ColdFusion 9 using the regular methods. It's been running quite smoothly if I do say so myself. I of course don't have the installation instructions anymore. Oops. I suppose I could Google for them again and make a copy or something. But well if my server ever crashes and I have to start all over again, yeah I'll worry aobut it then. FOr now, not so much. So here's my current setup: MySQL PHP Perl ColdFusion 9 Yeah something like that. Not too bad if I do say so myself. Of course what else would I say about it? You know I wouldn't ever say anything bad about my own server setup. Well unless I already have, if that's the case. Oops. Disregard that blog post. So yep, I think I'll have some fun with all of that for sure.

Form Field Woes

I was working on something today... more of a proof of concept. I had a dynamic form from which the user would fill it out and click submit. They would then see if they filled it out correctly. Well, I got a little stumped for a second or two regarding it... how would I check if the question was processed. Usually I do: IsDefined("form.fieldname") But with my question looking like: answer_#q.question_id# I couldn't quite do that. CF kept telling me it hated me. (Honest, those were its exact words.) So I had to figure something out. At first I thought I'd have to use Evaluate... but well would you know that would be the wrong course of action? Ran across a website that told me to do this: form["answer_#q.question_id#"] Would you know that it worked? Oh yes it sure did work. So that made my day.

Database Class

Been thinking of creating my own Database Class. Either PHP class or maybe a ColdFusion component... perhaps both. I imagine it would be something simple, something that takes arguments of the query built as strings. For CF, not sure how I would do a <,cfqueryparam>> on parameters send into the function, if the function accepts a string. So something to think about with that for sure. Not sure what I'll do with said class file(s) but yeah you just never know what it will bring.

Using like in a cfqueryparam

So there I was... attempting to figure out the best way to to a like clause in a query statement using the cfqueryparam tag. I had it coded like this: like <cfparam cfsqltype="cf_sql_varchar" value="#arguments.search_criteria#"> Well that didn't work. So I did some googling. After a little bit of searching, I finally found out how it should be coded. like <cfparam cfsqltype="cf_sql_varchar" value="%#arguments.search_criteria#%"> After laughing at how simple that was... I used it. Worked like a charm.

MySQL DateTime

Been attempting to put a datetime variable into a MySQL Database via ColdFusion. For the life of me, I couldn't figure out what I was doing wrong. At first I tried: #createODBCDateTime(now())# For some reason that was only giving me the date and not the time. Then I tried splitting up the date and time into two different fields, one for the date and the other for the time. Then I tried this code: #createODBCDate(now())# #createODBCTime(now())# That gave me the date, but still not the time. Well I did some searching and then found there's a built in function in MySQL to do this. Why not. Talk about simple: NOW() Well guess what, it worked just like a charm.

Hello World In ColdFusion

Ah now we come to ColdFusion. Such a great language to be programming websites in. I figured since I created a Hello World sample app in other languages, why not here. Here's the most basic output for ColdFusion: <cfoutput>Hello World</cfoutput> Of course we can make it a bit more fun... by using a variable to hold the "Hello World" in and then output that variable. In the next example, we'll use greetings as the variable. <cfset greetings="Hello World"> <cfoutput>#greetings#</cfoutput> So yep that's that, simple enough.

ColdFusion Good Times

ColdFusion has come a long way since I first started using it back in 2003. I started using version 5.0. It was at that time owned by Macromedia. Later on Macromedia was bought out by Adobe. I'm sure some were afraid that Adobe would cease production of ColdFusion, but they were good and played nice, keeping CF around. ColdFusion is currently in version 9. Not sure when version 10 will be released, but I'm sure it will have some good stuff to go with it. The updates usually do. Some things I find interesting about ColdFusion are the following: Rabid application development Integrate Java in with your pages, via cfc's or scripting Works nicely and plays well with others I'll come up with a better list later, but right now those come to mind. I mean it better play nice with Java, it was re written using Java altogether.