How to configure CFMX7 MySQL 4/5 connector J

I just wasted literally hours of precious time trying to set up the developer edition of CF MX7 to connect to my MySQL 5.1 server by following the (incorrect) instructions that appear all over the internet, including the Adobe support site.

These are the correct steps:

  1. Download the MySQL connector J verison 3 here
  2. Extract the connector file mysql-connector-java-3.1.10-bin.jar into the <cfroot>/runtime/lib folder NOT the <cfroot>/WEB-INF/runtime/lib folder as described in many other places on the internet.
  3. Restart the CFMX7 server
  4. In the CF administrator create a new datasource of type ‘other’
  5. Enter
    jdbc:mysql://[mysql erver]:[port]/[database]

    into the JDBC URL field

  6. Enter

    into the Driver Class field

  7. Enter MySQL user name and password
  8. Submit the new datasource

That should do the trick.

The best way to work with CFINPUT type=”checkbox” with MySQL

checkbox-1Since I began using CFML I’ve struggled with this problem every time I want to add a checkbox to a form that updates a database field.

The problem is that if the checkbox isn’t checked then no evidence of its existence is passed to the form’s action page. This causes a problem when updating a database field because you can’t rely on the FORM structure to provide a value of “no” or “off” that can be updated in your db field.
You therefore need to use something like this before your <cfupdate..>, <cfinsert…> or <cfquery…> tags.:

 <cfparam name="FORM.mycheckbox" default="off">

Similarly when populating a form containing a checkbox you need to use a plain <input type=”checkbox”> HTML tag instead of the CFINPUT version. This then allows you to insert <cfif> tag like so…

<input type="checkbox" name="myCheckbox" 
	<cfif #dbQuery.myCheckbox# eq 'on'> 

The db field must then be either a string-based data type or an enum type with ‘on’ and ‘off’ as its possible values.

How to set linux permissions for extension uploading in Joomla 1.5 using Plesk 8.6

I have had a bit of a nightmare getting a freshly installed Joomla 1.5 system to accept uploaded extensions. These are the steps I took:

  • disable safe mode for the domain in the plesk panel domain setup
  • Set permissions to 777 for:
    1. configuration.php
    2. /components
    3. /tmp
    4. /administrator/components
  • disable FTP layer in Joomola global config
  • This should allow basic uploading of components, although depending upon the component you may have to set 777 permissions for some other folders too.
    good luck.