This follows a previous article "How to install cakePHP on Ubuntu".
Assuming you've read the above article and your environment is all setup why don't we start baking right way.
Assuming you serve your pages from /home/username/public_html, at your terminal type:
cake bake public_html/appname
You'll need to answer a few questions...
Come with me to the bakery...
If you want to create models type:
cake bake -app /home/username/public_html/appname model
How to create controllers? easy and similar to the above line
cake bake -app /home/username/public_html/appname controller
Sure views are created differently, well no.
cake bake -app /home/username/public_html/appname view
Monday, April 27, 2009
How to install CakePHP on Ubuntu
Welcome,
am going to show you how I was able to
install cakePHP on Ubuntu 9.04 (with LAMP stack).
There's lots of good articles out there but for one who's having a first look at cakePHP.
Of course this article assumes you are able to setup your LAMP stack.
When you are done, we can continue...
You can install cakePHP easily by typing the following line at your terminal:
sudo apt-get install cakephp
The above command installs everything you need to start off your development.
We'll start baking in my next article: How to use cake bake on Ubuntu
am going to show you how I was able to
install cakePHP on Ubuntu 9.04 (with LAMP stack).
There's lots of good articles out there but for one who's having a first look at cakePHP.
Of course this article assumes you are able to setup your LAMP stack.
When you are done, we can continue...
You can install cakePHP easily by typing the following line at your terminal:
sudo apt-get install cakephp
The above command installs everything you need to start off your development.
We'll start baking in my next article: How to use cake bake on Ubuntu
Monday, September 22, 2008
How to Insert Select with AUTO_INCREMENT in MySQL
You want to include values and/or auto_increment selected from another table in your insert statement.
Here's how to:
Say you have created two tables as below:
create table t_lang(
lang_id integer unsigned auto_increment primary key,
lang varchar(50) not null);
create table t_geek(
geek_id integer unsigned auto_increment primary key,
geek_name varchar(50) not null,
lang_id integer unsigned not null);
To add a geek and their language specialty you'd do this:
insert into t_lang values(null,"Java");
insert into t_geek select null, "Charles", last_insert_id() from t_lang;
As simple as that!
Here's how to:
Say you have created two tables as below:
create table t_lang(
lang_id integer unsigned auto_increment primary key,
lang varchar(50) not null);
create table t_geek(
geek_id integer unsigned auto_increment primary key,
geek_name varchar(50) not null,
lang_id integer unsigned not null);
To add a geek and their language specialty you'd do this:
insert into t_lang values(null,"Java");
insert into t_geek select null, "Charles", last_insert_id() from t_lang;
As simple as that!
An introduction
As a programmer, you need to know quite a few languages, tools, techniques, methodologies and a lot more, all of which are available in a book or website or some other media.
My motive for starting this blog is so that we can share the knowledge we'v all gathered from these different sources.
for the benefit of all,
My motive for starting this blog is so that we can share the knowledge we'v all gathered from these different sources.
for the benefit of all,
Subscribe to:
Posts (Atom)