Questions tagged with database

1 answer

0 votes

Asked by ojtibi, on 30/10/09 in Shells

Creating schemas for models on different databases

Hi,

Here's my question, I was able to create schemas a few months ago but stopped because I made some custom models for tables on a different database, and for this particular example, a PHPBB surrogate model under the main app, same database...

2 answers

0 votes

Asked by lenzcom, on 31/10/09 in Models

How can i write to sqlite-memory:db?

Hi,

how must my db-config look like to write into sqlite memory:db?

thanks...

1 answer

1 vote

Query a second database

Hi, sorry if this is a really newbie question, but how can I get Cake to use a second database?

I've gone into database.php and set-up the second database:

	var $default = array(
		'driver' => 'mysql',
		'persistent' => false,
		'host' =>...

2 answers

0 votes

Asked by kyleb, on 19/12/09 in Controllers

Newb question: Building an index on a DB with crappy naming conventions

I'm trying to understand how to build an index in CakePHP without using scaffolding. Keep in mind that the database I am working with has tables that are in all caps and are not pluralized - example table names would be USER, VISIT, VISIT_DATA,...

1 answer

0 votes

Asked by jbrass, on 24/12/09 in Installation / Configuration

Custom Database Session

How could you create a custom Session handler that records extra information to the database.

Say you wanted to record the IP and the User Id (if they login) to the sessions table using a custom handler. Where would you start?

I have seen the...

0 answers

1 vote

Asked by stevenoxley.blogspot.com, on 28/12/09 in Controllers

How can I access the MySQL database connection from one of my controllers?

I have inherited some less-than-pretty code (using the CakePHP framework) that uses mysql_connect everywhere (at the top of practically every controller). Needless to say, that doesn't work very well when I want to change the database server...

2 answers

0 votes

Asked by avic, on 9/1/10 in Models

Quickest way to create web app to manage an existing MySQL database, enforcing database integrity?

Hi All,

I have less than two days to build a small web app that will manage an existing MySQL database (about two dozen tables, all related either via one-to-many or many-to-many)

By manage I mean not just the std CRUD stuff, but also enforcing...

1 answer

0 votes

Asked by joeyb, on 9/1/10 in Installation / Configuration

How do you change database naming conventions?

To use the 15 minute tutorial as an example:

CREATE TABLE posts

(

id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,

title VARCHAR(50),

body TEXT,

created DATETIME DEFAULT NULL,

modified DATETIME DEFAULT NULL

);

I would first like to use "Post" as the name of...

1 answer

0 votes

Asked by aiyer, on 10/1/10 in Views

Cakephp database column to model field convention

Howdy,

the cake php convetions page here (http://book.cakephp.org/view/24/Model-and-Database-Conventions) touches softly on the topic, but I thought i'd ask just to be, well, extra sure.

I have my form-input(column) code in my view. If the database...

0 answers

0 votes

Asked by shapan, on 23/1/10 in Installation / Configuration

Suitable database for CD application

Hello

I need to build a database CD application with proper database security. I am planning to use server2go (www.server2go-web.de) and cakephp with suitable database. Mysql is ok but I can't give proper security to my database. As you know in...

3 answers

0 votes

Asked by seph429, on 31/1/10 in Models

Relationship Problem

I am trying to configure CakePHP to act as a REST API for an app i'm writing.

I have 3 tables:


dishes {
 id,
 name,
 description
}

users {
 id,
 name,
 email
}

dishes_users {
 id,
 user_id,
 dish_id
}

I would like it so that when someone visits...

2 answers

0 votes

Asked by lordojazz, on 2/2/10 in Plugins

Plugin using different Dynamic Database Connection

Hello,

Has anyone here tried to create a plugin which connects to a

difference database dynamically?

My Plugin name is "News"

I have tried adding this lines on beforeFilter on my

ArticlesController:

$db =&...

2 answers

0 votes

Asked by blacksymmetry, on 5/2/10 in Models

Simple search form

Hello, I am new in CakePHP and I would like to ask, how can I make a simple search form?

I am observing CakePHP convention. Simple form with one input and searching in one table and few's columns.

Result will be written out under search form like...

3 answers

0 votes

Asked by blacksymmetry, on 10/2/10 in Models

Auth->fields, db fields- left or right?

Hello,know anyone that name of db columns is on left, or right?

function beforeFilter() {

$this->Auth->fields = array(

'username' => 'username',

'password' => 'secretword'

);

}

0 answers

1 vote

Asked by marion, on 11/2/10 in Controllers

Une seule requête sur plusieurs bases

Bonjour,

j'ai besoin de faire une seule requête sur plusieurs bases de données. J'ai défini mes associations pour que le LEFT JOIN se fasse correctement sur la table de l'autre base, la requête est correcte.

En revanche, bien que j'aie préfixé mes...

6 answers

0 votes

Asked by jepster, on 23/2/10 in Models

Fatal error: Class 'DATABASE_CONFIG' not found

Hi,

I've downloaded cake 1.2.6, installed it and then I've started baking. but then the database configuration cannot be configured. I had this problem a few times. at the end cames always the message

Fatal error: Class 'DATABASE_CONFIG' not found...

1 answer

0 votes

Asked by touchaponk, on 26/2/10 in Models

Cakephp adding empty record into database

Hi,

I've develope a mobile phone website based on cakephp and after I published the website, I started to have empty record added to my phones' database without knowing where's the source of the problem.

I've tried beforeSave() callback to try to...

1 answer

0 votes

Asked by braincramp, on 8/3/10 in Views

how do you parse php from database in views?

I am building a CMS and would like to include such tags as <?php echo $html-link() ? in content items. However, when I display the content items, PHP code is being presented as text. Is there a way to parse the PHP from database content items in...

0 answers

0 votes

Asked by revenantprime, on 18/3/10 in Helpers

Use model within helper

Hi all,

I know MVC speaking it's not kosher to access a database within a helper, but this is the situation I'm in.

I'm creating a parser where people can specify thumbnails for images in the database by inserting a tag like [thumb, id, width,...

1 answer

0 votes

Asked by martu, on 22/3/10 in Models

extra fields when using tree behavior

i was working with the example at:

http://book.cakephp.org/view/228/Basic-Usage

next, when i use generatetreelist(), i get a plain list with the records id and names.

i need extra data from this table, like url, but i can't find a way to get extra...

<< previous 1   2   3   4   5   6   7