jump to navigation

NOTE: The spam filter is being unusually aggressive. If you comment does not immediately appear, it has simply been placed in moderation and I will approve it as quickly as possible. Thank you for your patience.

"Murphy was an optimist!"

WordPress 3.4 limited to 90 menu items June 19, 2012 9:26 am

Posted by Doug McCaughan in : MySQL, PHP, Programming, Software, Technology, WordPress
, 11comments

I’m working on a WordPress site. The site is to have roughly 106 pages all accessible via the WordPress menu system so that the enduser can add and remove pages from the menu as they like. Unfortunately, WordPress currently only allows 90 nodes (ie. 90 menu items) per menu. I have not figured out if this is a memory limitation, a hard coded limitation, or a setting yet. This must be overcome!


Possible solutions:


Seeking Next Project March 19, 2009 8:26 am

Posted by Doug McCaughan in : Announcements, ColdFusion, CSS, HTML, JavaScript, jQuery, MS SQL, MySQL, Of Interest, PHP, Programming, Technology
, add a comment

I am coming to the end of a project and have an opening in my schedule. My strengths are programming in PHP, ColdFusion, JavaScript and jQuery, CSS, and HTML. I most frequently work with MySQL or MS SQL but can work on most database platforms. Code I write validates and is W3C compliant. I can also write Section 508 compliant code. I carry a project from concept to production as project manager, independent developer, and/or project team member. In addition to custom original code, I work well with open source projects and APIs. I usually telecommute but am not adverse to working onsite or traveling. I am not an artist and typically hire a graphic artist to provide the design for each project. I enjoy WordPress customizations (but have not done custom work to either Reality Me or Domestic Psychology). Please send referrals or inquiries to jugger@gmail.com or call +1-865-898-7189. Thank you!

add a comment

Today’s Technical Brain Cloud January 2, 2009 11:39 am

Posted by Doug McCaughan in : MySQL, Programming, Technology
, 4comments

Having a stupid moment and maybe you can help. I’m trying to count how many times an employee is scheduled using MySQL. I would like to have a column that for George says "3" and for Lucy says "2" but if I group on EmployeeID and use count(e.EmployeeID) I end up with 2 rows instead of 5. How do I retain the 5 rows of data and still get a count of 3 for George and 2 for Lucy? My output will show that George has schedule Sat-Mon, Tues-Fri, and Wed-Sun and will say "George is scheduled 3 times."

CompanyID AffiliateID EmployeeID EmployeeName Schedule
1   23   11   George   Sat-Mon
1   23   11   George   Tues-Fri
1   23   11   George   Wed-Sun
1   23   15   Lucy   Sun-Mon
1   23   15   Lucy   Thur-Fri

SELECT c.CompanyID,
FROM companies c
LEFT OUTER JOIN subscription s
     ON c.CompanyID = s.CopmanyID
LEFT OUTER JOIN affiliates a
     ON a.AffiliateID = s.AffiliateID
LEFT OUTER JOIN employees e
     ON ae.AffiliateID = a.AffiliateID
LEFT OUTER JOIN schedules s
     ON s.EmployeeID = e.EmployeeID
          AND s.CompanyID = c.CompanyID
          AND s.AffiliateID = a.AffiliateID
WHERE (s.StartDate <= FROM_UNIXTIME(1227243599)
     AND s.EndDate >= FROM_UNIXTIME(1227157200))
     AND c.CompanyID = 1
ORDER BY c.CompanyName, s.AffiliateID ASC

I know this is not a complex SQL problem. I’ve done this in the past but today I am being dense and am stumped.


Do you store images in a database? July 11, 2008 11:15 am

Posted by Doug McCaughan in : .NET, ASP, c#, MS SQL, MySQL, Programming, Technology
, 4comments

As I have built PHP and ColdFusion applications over the years, I have had to deal with image and file uploading from the application. Browsers were not designed for moving files from a client to a server; specifically, browsers were designed to receive files from a server to a client. To move files from a client to a server, an FTP program is used. (My favorite FTP client is WinSCP.) Now, a form can be written and used to upload a picture, movie, or other file from the client (you) to the server. You probably do this quite frequently with Flickr, Youtube and so forth. It is convenient from the enduser point of view because it removes the need to learn new software (the ftp client) and prevents having to get an administrator to create a username and password for each user on the server. Plus, by managing the files through the web application instead of the FTP program, you can programmatically control what is being allowed onto the server so that your user doesn’t maliciously upload an executable designed to damage the server rather than that family vacation photograph.

As a programmer, I have to make decisions about where to store these uploaded files. A common approach is to have a directory on the webserver which cannot be accessed by a browser (that is, the only way to get to the file is through the programming). The filename is then stored in the database. As an independent consultant, I work with different programmers/designers with varied skillsets and differing philosophies on coding. Some coders, like Eric Wise, actually prefer to store the files in the database itself. Eric claims:

…this is pretty sloppy and difficult to manage especially if for some reason you want to reorganize the data… [Source, Eric Wise, Images, Thumbnails, SQL Server, and ASP .NET – Level 200]

Eric describes a process of storing images in SQL Server 2005, automatically compressing the images, and generating thumbnails using ASP .NET. THis is interesting to me as I am wanting to learn C# to add to my skillsets.

I am concerned about database size and performance decreased caused by storing images/files in a database rather than storing the file in a directory and only storing the filename in the database. Jeffrey Palermo, a commenter on Eric Wise’s post, expresses the same concern:

Jeffrey Palermo said:

I’ve considered doing a photo album this way, but the main drawback is the size it makes the database. I have about 4GB of images. Do I really want that much in my database just for images. That also makes the bandwidth between web and db server highly used. Perhaps it’s no big deal, but to date I’ve kept my photos on the web server. Please post if you find no issues with the size of the data in the database when you have _lots_ of pictures there.

And Eric responds:

Eric Wise said:


With the compression tool I referenced, the original image shown was over 2MB, now it’s 165KB.

Having many large files would definately cause a performance issue, but with compression and the fact that it will probably be rare to have more than 2-3 pictures of an asset I’m not all that concerned about it.

What is your approach to storing images from a web application? See also.


Blogging saves me time! October 23, 2007 10:43 am

Posted by Doug McCaughan in : Blog, ColdFusion, Daily Life, MySQL, Publishing, Technology
, add a comment

Why do I blog? Because when I spend a large amount of time troubleshooting, the next time the problem comes around (like getting ColdFusion 7 to connect to a MySQL datasource), I just have to read the post.

add a comment

MySQL Took Us Halfway September 20, 2007 4:58 pm

Posted by Doug McCaughan in : MySQL, Programming, Technology
, add a comment

I’m very disappointed that the MySQL Migration Toolkit is unidirectional. It will take a variety of databases and bring the structure and data into MySQL but won’t go the other way. I know it doesn’t seem to be in MySQL’s best interest to create a tool that would port away from their product but it really would serve them. Guess I need to see what DTS can do.

add a comment

Tech Issue of the Day July 26, 2007 1:37 pm

Posted by Doug McCaughan in : ColdFusion, Daily Life, MySQL, Programming, Technology
, 2comments

Today’s terribly frustrating error causing a long delay in a short process is:

Parameter index out of range (1 > number of parameters, which is 0).

It is the result of this simple insert:

<cfquery name="createrole" datasource="#application.gDataSrc#">
    INSERT INTO #application.projectidentifier#_theroletable {
    } VALUES {
       <cfqueryparam cfsqltype="CF_SQL_INTEGER" value="#fooAsIntValue#">,

UPDATE: Whoops. I see the typo! There is a big difference between {} and (). Should have been:

<cfquery name="createrole" datasource="#application.gDataSrc#">
    INSERT INTO #application.projectidentifier#_theroletable (
    ) VALUES (
       <cfqueryparam cfsqltype="CF_SQL_INTEGER" value="#fooAsIntValue#">,


MySQL Migration – Slick July 13, 2007 3:49 pm

Posted by Doug McCaughan in : MySQL, Programming, Technology
, add a comment

I really, really like the MySQL migration tool. I just can’t say it enough.

add a comment

MySQL and CFMX7 July 6, 2007 11:47 am

Posted by Doug McCaughan in : ColdFusion, MySQL, Programming, Technology
, add a comment

I’m jumping the hoops again on another server.

Update: After beating my head into the wall, bleeding on my keyboard, restarting a server and having it almost not come back to life, I realized that "commysql.jdbc.Driver" and "com.mysql.jdbc.Driver" are not the same thing. Oh the angst that can be caused by missing a period!

add a comment

Securing Contacts and Jobs October 16, 2006 11:32 am

Posted by Doug McCaughan in : AJAX, ColdFusion, Daily Life, MySQL, Programming, Technology
, add a comment

I just put a resume out on this one. Sounds fun!

Duties and Responsibilities:
– Assist in composing web pages and in creating special sections as assigned by the Site coordinator
– Work hands-on in the development of web applications (AJAX/HTML/Javascript)
– Competence creating table-free layouts
– Prototype, develop, and maintain new features and enhancements
– Operates as a leader/lead worker among other staff, shares knowledge or training with subordinates and/or colleagues to benefit the entire department
– Participate in workflow design and analyze existing production and implementation processes in order to insure the overall quality of the sites
– Maintenance and support of existing templates and content production processes
– Perform web development, template writing, testing debugging, documentation, and installation tasks for on-line processes in accordance with industry best practices and specific internal procedures and standards
– Partner with Web-ops to ensure that interactive techniques and technologies translate through to shipping products and services

One of the challenges of working for yourself is you have to shoot at a lot of barns to hit some work. The problem is barns move pretty quick! Sometimes it is just plain difficult to find a barn. Then the barn’s owner looks at you and may not even give you permission to shoot at the barn in the first place much less give you the barn.

Playing low budget developer and sales person at the same time can lead to missed deadlines or living with very little sleep. Finishing a project, then turning on sales mode can lead to dry spells where you wonder how you’ll eat. Ideally, you should be working with a sales person!

add a comment