Difference with ASP, PHP, CF, and more

jag5311's picture

They have: 202 posts

Joined: Jan 2002

I am just wondering, I know these are all different programming languages, but what is the difference in their functions on a website/database.

What can Coldfusion do that ASP and PHP can't. and Vice Versa for the other two.

This has always confused me

Thanks
bryan

They have: 447 posts

Joined: Oct 1999

when it all comes down to it, theyre all pretty much the same. ASP has some microsoft activeX and visual studios .net things, Cold Fusion has a IDE and is very tag-based like HTMLScript was, and (i think) hard to work with. all in all, php, perl, asp, cfm, python, etc can all do the same thing, no single one has a unique feature so great to warrant using it, its all personal preference.

php makes alot of things easy that the others dont, though. if youre looking to learn, go with php.

jag5311's picture

They have: 202 posts

Joined: Jan 2002

Do you know some good resources for php?

Thanks
Bryan

does PHP use MYSQL, or SQL (never quite understood the difference)

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

you can use php with any db, I believe. MySQL is a type of database, as is SQLServer (MS db).

php.net is a good reference, but I'd recommend picking up a book on the topic.

openmind's picture

He has: 945 posts

Joined: Aug 2001

Quote: Originally posted by R0B
Cold Fusion has a IDE and is very tag-based like HTMLScript was, and (i think) hard to work with. all in all, php, perl, asp, cfm, python, etc can all do the same thing, no single one has a unique feature so great to warrant using it, its all personal preference.

php makes alot of things easy that the others dont, though. if youre looking to learn, go with php.

Disagree.

Sorry Smiling that was pretty blunt but consider that in CF you have to write about 75% less code than in PHP or ASP. Now I don't fully know the PHP language but I could be wrong so lets have a challenge! Smiling

Write code to do the following:

Select 1 item from a table using SQL that has been passed within a variable called ProductID
Output that the name, model and colour of that ProductID using the language of your choice.

Here's how to do it in CF:

<!---Select the item--->
<cfquery datasource="dsn" name="get">
  SELECT *
  FROM TableName
  WHERE ProductID = #ProductID#
</cfquery>

<!---Now for the output--->
<cfoutput query="get">
  #Name#, #Model#, #Colour#
</cfoutput>
'

Tell me thats not quick, simple, effective and shorter than anything else out there!!!

I'll probably get proved wrong now I've laid my neck on the line Wink

nike_guy_man's picture

They have: 840 posts

Joined: Sep 2000

<?php
//Select
$output = mysql_fetch_assoc(mysql_query(\"SELECT * FROM tablename WHERE productid = '$productid' \"));
echo \"
$output[Name], $output[Model], $output[color]\";
?>

That works for MySQL and PHP... and that assumes you are connected to the DB... does CF require a connection? like mysql_connect() in PHP?

Laughing out loud

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

I'm guessing Flipper was using a DSN connection (Data Source Name). I've always hated DSN connections. When I program in ASP with SQL server, I always use DSNless connections.

Mark Hensler
If there is no answer on Google, then there is no question.

jag5311's picture

They have: 202 posts

Joined: Jan 2002

What is the difference betweeen DSN and DSNless

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

When using DSN connections, you refer to the Database by using a pre-determined name. The computer (or server) then chesks it's tables for the specific connection info (host, user, pass).

On WinXP:
Start > Settings > Control Panel > Administrative Tools > Data Sources (ODBC)
The first tab is "User DSN". Click "Add...", pick your DB type, then specify the connection info.

DSNless connections is just using a standard connection (similar to what is normally done in PHP). The only language I've used both methods in is ASP. I briefly tried using DSN with Java, but gave up before I got it working.

Mark Hensler
If there is no answer on Google, then there is no question.

openmind's picture

He has: 945 posts

Joined: Aug 2001

Oh no, what have I started! Wink

It can also be done with a DSN less connection. Just declare the DSN in the application.cfm file so it can be called on any page like so:

<cfset Get= "
   Driver={Microsoft Access Driver (*.mdb)};
   Dbq=MyDatabase.mdb;
   DefaultDir=D:\path2files\;
   Uid=Admin;
   Pwd=Password;">
'

The CFQUERY section changes slightly to :

<cfquery name="GetExample" connectstring="#Get#" dbtype="DYNAMIC">
  SELECT *
  FROM TableName
  WHERE ProductID = #ProductID#
</cfquery>
'

I think at the end of the day, you should use which ever language you feel most comfortable with but I am still of the opinion that CF is easier to learn....

So there.... Wink

jag5311's picture

They have: 202 posts

Joined: Jan 2002

I got a new question. This is a dumb one, but I am completely lost on it. I understand one way of connecting with databases Via ASP, PHP, or CM is through Access database files, I believe .mdb or something extensions. I have heard though, that this can cause problems since the file must be opened online (or something) and sometimes can be corrupt or damaged, especially in a database of 1000's of items. There is also the way of SQL or MYSQL (not sure the difference) but how is that put together. Is there a program that allows you to manage your queries/tables/forms ect.., or is it done using a standard text file. This is where I have gotten confused. With Access, you create your mdb file, upload it, tell your .php,.cm, .asp file to located the particular database file, and match the criteria. What is the NON-ACCESS way.

Thanks in advanced. I am just thirsty for knowledge:)

Bryan

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

r u talking about phpmyadmin?

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

I think of Access more of a desktop database for individual use. But, of course, people do use it in a larger scale.

"MySQL is the world's most popular Open Source Database, designed for speed, power and precision in mission critical, heavy load use." -- from the mySQL site. Something I like to brag about: NASA switches from Oracle to MySQL Laughing out loud

(SQL) "Microsoft SQL Server ... is the complete database and analysis offering for rapidly delivering the next generation of scalable e-commerce, line-of-business and data warehousing solutions." -- from the Microsoft site.

You really can't compare Access to the other large scale DBs. Access uses non-standard datatypes, contains the whole DB in one file, incorporates 'forms', has a really funky format for queries, and yadda yadda yadda.

Something else which distinguishes Access... one file = one database.
Both mySQL and MS SQL are server. And each server can contain many databases. Just as an IIS or Apache server can contain many VirtualHosts.

Also, mySQL and MS SQL have no concept of 'forms'. Real database servers aren't used for formatting/presenting data. You do that yourself using whichever technology you use to query the DB.

MS SQL and mySQL aren't single files that you manipulate with managing software. Rather, their services (for windows) or servers (for unix), which are running continuously (similar to IIS or Apache).

To administer a MS SQL server, you run a program (forgot the name) on a client and connect to a SQL server. It has a full GUI interface which allows you to administer everything.

To administer a mySQL server, you typically log into a telnet or SSH session. Then run `mysql -u root -p`. This will give you a mySQL prompt which will accept written sql commands. mySQL doesn't come with a GUI. But you can use the popular web based GUI called phpMyAdmin.

Mark Hensler
If there is no answer on Google, then there is no question.

jag5311's picture

They have: 202 posts

Joined: Jan 2002

Thank you so much, finally a clear explanation. I bought Ben Forta's Learn MYSQL in 10 minutes, and couldn't figure out where I could start preparing a database

jag5311's picture

They have: 202 posts

Joined: Jan 2002

Dumb question, but how do I know which database I need to download from mysql.com?

I run Windows 98.

Thanks
Bryan

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.