Recent Posts
- (09/10) Fixing Warning: the ECDSA host key for 'github.com' differs from the key for the IP addressTAGS:Web Server Admin
- (12/26) CakePHP 3 - Getting List of Column Definitions from a Table (like schema())TAGS:CakephpCake3
- (09/14) Change Order of Loaded Behaviors in CakePHP 3TAGS:Cake3CakephpWeb ProgrammingPhp
- (05/29) CakePHP 3 - Accept JSON Header Only Working When Debug FalseTAGS:Web ProgrammingCakephpCake3
- (05/23) Remove All Events from Google Calendar (Reset Calendar)TAGS:Web ProgrammingPhp
- (11/08) Google Tag Manager (GTM) Not Firing Default PageView EventTAGS:Web ProgrammingJavascriptGoogle Tag Manager
- (10/13) In PHP, how do you get __toString() Magic Method Result without calling echo?TAGS:CakephpCake3Cakephp 13PhpWeb Programming
- (11/14) Getting output from shell_exec() at all timesTAGS:Web ProgrammingWeb Server Admin
Subscribe to my feed
MainelyDesign.com Blog
Mssql Tagged Blog Posts
Forcing A Single Join in CakePHP Pagination
Posted on 10/14/2011 at 09:25 am | Viewed 22,534 times | 0 comments
The devil's in the details... I was trying to make a really simple, dreadfully easy, database join in my CakePHP web application. I've forced joins in Cake before, using the 'joins' key in the options array for find calls and paginate calls with no issue. It was late and for the first time I only wanted to use a single join. I copied the join code from a much more complex web app and pasted it into my new 'joins' conditions. And then... I got SQL errors.
Read: Forcing A Single Join in CakePHP Pagination | View: Comments
Inserting NOW() into MySQL Using CakePHP
Posted on 08/11/2011 at 11:16 pm | Viewed 14,746 times | 0 comments
Great find. If you want to insert NOW() into your query using CakePHP's save() or saveAll() functions, you can use the following expression:
$this->data['Model']['custom_date_field'] = DboSource::expression('NOW()');
Not sure how it works on MSSQL, but I will be testing that soon.
Cheers,
-Kevin Wentworth
Read: Inserting NOW() into MySQL Using CakePHP | View: Comments
Using Between with Date Ranges in Proper DB Date Format
Posted on 07/09/2009 at 11:56 am | Viewed 18,215 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 function for date ranges
Read: Using Between with Date Ranges in Proper DB Date Format | View: Comments
Pagination with MSSQL in CakePHP
Posted on 05/07/2009 at 04:36 pm | Viewed 16,794 times | 0 comments
One thing, and there are a few, that I can't stand about having to use PHP and MSSQL Server together is the lack of support for pagination. With PHP and MySQL- no problem use limit. MSSQL- can't do it without all these ugly sub-queries. I have to give it to the CakePHP developers though, for the built-in support for pagination in MSSQL. Albeit it is flawed, it works.
Full Tag List
- Cakephp
- Web Programming
- Site Avenger
- Excel
- Csv
- Database
- Saveall
- Vendors
- Import
- Truncate
- Empty Table
- Forms
- Habtm
- Usage
- Tinymce
- Geshi
- Usability
- Upgrade
- Graphic Design
- Internet Marketing
- Software
- From The Hip
- Midcoast Magnet
- User Group
- Component
- Mssql
- Git
- Apache
- Seo
- Htaccess
- Mysql
- Eclipse
- Gear
- Photoshop
- Php
- Css
- Iis
- Web Server Admin
- 404 Errors
- Iisreset
- Web Design
- Hack
- Internet Explorer
- Ie
- Firefox
- Forum Answers
- Jquery
- Swfupload
- Windows
- Example
- Links
- Tutorial
- Errors
- Behaviors
- Cakephp 13
- Humor
- Music
- Jquery Ui
- Ui
- Wamp
- Cloudfiles
- Setup
- Javascript
- Responsive
- Quick Tip
- Cake3
- Foundation
- Google Tag Manager