How to select table from database using CFM
After our lesson I learn something on how to connect your CFM statement to the databse. This is a simple statement that being use in Coldfusion language. This statement help the user to connect or to select a data from the database.
<cfquery name="student_profile" datasource="ds_studprof" >
SELECT first_name, last_name FROM student_prof WHERE last_name LIKE ‘#search#%’
</cfquery>
In order to make a CFM statement you should have first to put the opening and the closing tag of this language which is the cfquery. cfquery helps us to create a request on the database. Then the name followed by our datasource in which we were going to get our data. Then the keyword SELECT and the name of the table, THEN is another keyword and then the name of your table in which the data is located. WHERE is a keyword in which it will going to filter all the data going our from the database. I hope that this idea can help you.




