Overview
KB
Learn PHP
PHP techniques
PHP Smarty Functions
PHP Web Email
Secure development
PHP Security Scenario
SSH and SFTP
PHP Smarty
PHP Smarty Modifiers
PHP Smarty Caching
PHP Smarty Misc
CakePHP
Zend Framework
PHP basics

CakePHP Development

Following CakePHP Blog tutorial with PhpED: Configure MySQL

This section is following sections 3 and 4 of CakePHP Blog tutorial.
We will start by configuring Blog's MySQL database using PhpED's MySQL database connection client. Ben Horde pointed out to the nice way of starting XAMP in his Joomla tutorial, feel free to do the same to start and stop MySQL server on your computer. Then you can:
  • Setup MySQL account as described in MySQL database connection client tutorial and open it
  • Copy paste the following table creation code from CakePHP 15 minutes Blog Tutorial:
/* First, create our posts table: */ 
CREATE TABLE posts ( 
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, 
title VARCHAR(50), 
body TEXT, 
created DATETIME DEFAULT NULL, 
modified DATETIME DEFAULT NULL 
);        

/* Then insert some posts fortesting: */ 
INSERT INTO posts (title,body,created) 
VALUES ('The title', 'This is the post body.', NOW()); 
INSERT INTO posts (title,body,created) 
VALUES ('A title once again', 'And the post body follows.', NOW()); 
INSERT INTO posts (title,body,created) VALUES 
('Title strikes back', 'This is really exciting! Not.', NOW());
into SQL window of the client and execute it: CakePHP MySQL Setup

You will need to get back into MySQL database connection client later to create a new user 'cakeBlog' used in the tutorial - note that tutorial never mentions that! But that's Ok, we got you covered.
Section 4 of the tutorial continues Cake Database Configuration and explains how to edit database.php.default file. Edits are easily done using PhpED PHP Editor Tools, but the time has come to create a new user in the database. You can do it by running the following statement in the SQL tab of MySQL database connection client:
GRANT ALL PRIVILEGES ON *.* TO 'cakeBlog'@'localhost' 
IDENTIFIED BY 'c4k3-rUl3Z' WITH GRANT OPTION;
Once it is done and you have edited database.php.default and changed its name to database.php, you can make sure that cake can connect to the database. Just open index.php file in PhpED and hit Run button. Here is what you should see, if your PhpED's PHP Viewer is configured to be embedded Mozilla/FireFox: CakePHP PHP Viewer connect


Article continues:  <<previous page  next page>>

 Download NuSphere PHP IDE

Download a free trial of the fast PHP EDitor and robust Integrated Development Environment for PHP.

 Buy NuSphere PhpED® now

Best PHP Editor and complete PHP IDE.
NuSphere PhpED 20.0 is available from our online store front.

 Special Team4 Offer

Get 4 copies of PhpED for the price of 3!

Optimum solution for development teams.
PhpED 20.0 Team4
Need more than 4 licenses? Contact Us for more quantity discounts, please use "Ordering/Payment issue" subject on the form.
"To be honest its bloody awesome, I have looked at loads of PHP editors and this is THE only one that actual works straight out of the box!!! Brilliant, well done."
Andrew Breward,
Director of Technology
caboodal.com