MainelyDesign.com Blog

Showing articles 121 - 130 (147 total)

Using Between with Date Ranges in Proper DB Date Format

Posted on 07/09/2009 at 11:56 am | Viewed 17,899 times | 0 comments

I need my CakePHP apps to run on both LAMP and Windows IIS using MSSQL Server.  Usually this isn't a problem because CakePHP does such a good job of database abstraction and database independence.  However, I came across a scenario the other day where I needed to select a date range using the BETWEEN SQL command. Using CakePHP's BETWEEN...

Adding Anchors to Your CakePHP Generated Urls (#link)

Posted on 07/02/2009 at 09:02 am | Viewed 34,866 times | 2 comments

This may seem simple and trivial, but it took me a little while to figure out.  If it saves someone a little trial-and-error then great (I know I won't forget how to do it). I needed to create a redirect in CakePHP that redirected to an inline, on-page anchor- <a name="destination">Scroll to Here</a>.  Typing the link directly into the address...

Using CakePHP's Set Class to Make Select List Options

Posted on 06/19/2009 at 11:22 am | Viewed 12,933 times | 0 comments

If you haven't become familar with any of the functionality of the CakePHP's Set class, I highly recommend you take a peak .  I don't know too much about it and really only learn about it as I go.  Well, I finally found out how to do something that used to take several lines of code: creating options for a select list that includes the...

Changing the CakePHP Model Schema on the Fly

Posted on 06/11/2009 at 10:28 am | Viewed 13,909 times | 0 comments

I have an interesting way of dynamically changing a model's validation on the fly.  I have a standard approach that involves contact forms, contest entries, etc. using a database to store which fields should be on a form.  I tweaked this over time, and recently needed to change the schema from text, which all answers have been up to this point...

Displaying phpinfo() without CSS styles

Posted on 06/09/2009 at 10:18 am | Viewed 22,796 times | 1 comment

I wanted logged in users to be able to see the output from phpinfo(); within Site Avenger.  The problem with using phpinfo() is that it outputs a full HTML page, CSS styles and all.  In the past this has been fine, but now I wanted to show the phpinfo() within the Site Avenger layout and CSS styles.  I came across a simple, yet highly effective...

Getting the File Path to the Vendor Folder

Posted on 06/08/2009 at 04:47 pm | Viewed 13,946 times | 0 comments

I'm trying to use a library within my CakePHP application that needs a variable defined that contains the complete file path to the vendors folder.  This can be solved one of two ways- modify the library (which I don't want to do) or use the Configure::corePaths() function in CakePHP. Best Option - using Configure::corePaths() This is a great...

Fixing the Default HP OfficeJet Scanner Settings (which suck)

Posted on 05/28/2009 at 11:11 pm | Viewed 12,874 times | 0 comments

The default settings for my OfficeJet L7500 All-In-One Scanner suck!  I thought the scanner was junk.  Every photo I scanned, espcially glossy finished photos, were coming out looking like they were from a 1960s era camera: over-exposed and super high contrast.  Not good!  I thought I had good Photoshop skills, but even they were no match for...

Distinct vs. Group By in MySQL (and CakePHP)

Posted on 05/21/2009 at 11:27 am | Viewed 21,319 times | 2 comments

An interesting problem- I am returning a list of files that have already been uploaded, so the user can link to an existing file.  This creates a new record (duplicate record).  The next time the user goes to select a file, there will now be two entries for the same file.  DISTINCT to the rescue, or so I thought. DISTINCT applies to the whole...

Best Eclipse Feature: Link With Editor

Posted on 05/21/2009 at 09:43 am | Viewed 16,217 times | 0 comments

I use Eclipse for all of my CakePHP development work.  I love that you can get code completion, class inheritance, and more by following these steps .  I also loved that I could have 20 something files opened, and when I changed the active document in the editor, my PHP Explorer hierarchy would change in response.  So, I upgraded my Eclipse...

Dealing with MySQL Old-Style Passwords

Posted on 05/20/2009 at 04:37 pm | Viewed 12,323 times | 0 comments

I ran into a problem I've seen before- Client does not support authentication protocol requested by server; consider upgrading MySQL client. Last time I came across this MySQL error, it was a simple query to fix the issue (from dev.mysql.com ): UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd') WHERE Host = 'some_host' AND User =...

    7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15   

Meet Site Avenger - Hosted Content Management System

Powered By: Site Avenger | Site Production: Saco Design