Help with SQL commands to interact with a MySQL database
- Mac /usr/local/mysql/bin
- Windows /Program Files/MySQL/MySQL version/bin
- Xampp /xampp/mysql/bin
<cffunction | |
name="ColorCode" | |
access="public" | |
returntype="string" | |
output="false" | |
hint="This takes code samples and color codes for display."> | |
<!--- Define arguments. ---> | |
<cfargument name="Code" type="string" required="true" /> |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js"></script> | |
</head> | |
<body> | |
<style> | |
body { | |
font-family: Arial, Helvetica, sans-serif; |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
<cffunction | |
name="ColorCode" | |
access="public" | |
returntype="string" | |
output="false" | |
hint="This takes code samples and color codes for display."> | |
<!--- Define arguments. ---> | |
<cfargument name="Code" type="string" required="true" /> |
<cfloop index="thefield" list="#form.fieldnames#"> | |
<cfset fields="#thefield# = #form[thefield]#"> | |
<cfset fields="#thefield# = #evaluate(thefield)#"> | |
<cfoutput>#fields#</cfoutput><br> | |
</cfloop> | |
Example making the form fields into hidden Form Fields | |
<!--- ********************************************** ---> | |
<cfloop index="thefield" list="#form.fieldnames#"> | |
<input type="hidden" name="#thefield#" value="#form[thefield]#" /> |
<basefont face="arial" /> | |
<CFSET REQUEST.DSN = "yourdatasource" /> | |
<CFSET REQUEST.OWNER = "owner" /> | |
<CFQUERY NAME="tables" Datasource="#REQUEST.DSN#" > | |
SELECT table_name | |
FROM all_tables | |
WHERE owner = '#REQUEST.OWNER#' | |
ORDER BY TABLE_NAME | |
</CFQUERY> |
component{ | |
public void function configure(){ | |
variables.coldbox = { | |
appName = application.applicationName, // I'm not over the moon about this break of encapsulation, but equally I want to be as DRY as possible. I dunno why I need to specify this (again) | |
appHomeUrl = "http://#CGI.http_host##CGI.script_name#", | |
defaultEvent = "bug.main", | |
// TODO: get rid once I understand what's going on | |
HandlersIndexAutoReload = true, |
<cfcomponent output="false" extends="coldbox.system.EventHandler"> | |
<!--- Default Action ---> | |
<cffunction name="index" returntype="void" output="false"> | |
<cfargument name="event"> | |
<cfset event.setView("general/mypdjfosdjfopjsapof")> | |
</cffunction> | |