Menu
  • HOME
  • TAGS

CakePHP - all pages blank except the home page

php,cakephp,cakephp-1.3

For me it looks like a problem with mod_rewrite, look on http://m.gratuito24.com/index.php/ads/index/showAds:goods/language:bg.html, index.php part is important, first thought: no mod_rewrite on server, second: something wrong with .htaccess...

Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual

cakephp,cakephp-2.0,cakephp-1.3,cakephp-2.1,cakephp-2.3

updateAll() does not automatically wrap string values in quotes unlike when using save(). You have to do this yourself. From the docs:- Literal values should be quoted manually using DboSource::value(). You need to wrap each string value in $this->request->data with quotes using something like the datasource's value() method before calling...

how to display max and min number from database in cakephp

cakephp,cakephp-2.0,cakephp-1.3,cakephp-2.1,cakephp-2.3

Use below query $rs = $this->Item->find('all' , array ('fields' => array('Max(Item.no) as no'))); This query will return max number in below format Array ( [0] => Array ( [no] => 27 ) ) $max = $rs[0]['no']; ...

cakePHP, page to a certain record

php,pagination,cakephp-1.3

If you got the ID, and you are auto_incrementing the ID in your database, you can count row before this ID: $nbRow = $this->Item->find('count', array('conditions' => array('id <=' => $id))) ; Then to find the page, you just have to divide (int division) by the number of item per page:...

Return all records that match array of conditions using CakePHPs find

php,mysql,arrays,cakephp,cakephp-1.3

That is the expected result. You are working against the ORMs auto-magic. Passing a string will result in an equality comparison, ie WHERE x = y, and since id is most probably an integer, the casting will turn the string 1,2,3,4 into 1, so ultimately the condition will be WHERE...

1.3 to 2.0 migration error (Notice: Undefined index: controller in Dispatcher.php)

cakephp,migration,cakephp-2.0,cakephp-1.3

Check the source The error message comes from the dispatch function: public function dispatch(CakeRequest $request, CakeResponse $response, $additionalParams = array()) { if ($this->asset($request->url, $response) || $this->cached($request->here)) { return; } $request = $this->parseParams($request, $additionalParams); Router::setRequestInfo($request); $controller = $this->_getController($request, $response); if (!($controller instanceof Controller)) { throw new MissingControllerException(array( # line 83 'class'...

Applying PURE html in view (.ctp file) in CakePHP

html,cakephp,cakephp-1.3

<form action="/project_name/users/add" id="UserAddForm" method="post"> First name:<br> <input type="text" name="data[User][firstname]"><br> Last name:<br> <input type="text" name="data[User][lastname]"><br> <input type="submit" value="Submit"> </form> I think this not recomended solution Use these keys if you need to inject some markup inside the output of the input() method: echo $this->Form->input('field', array( 'before' => '--before--', 'after' => '--after--',...

mysql_real_escape_string is not working in cakephp

cakephp,cakephp-2.0,cakephp-1.3,cakephp-2.3,mysql-real-escape-string

I don't know cake php, but IMHO, you just cannot use mysql_real_escape_string, because: firstly, it is deprecated. This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQL extension should be used. secondly, according to php doc : The MySQL connection....

Moving a CakePHP 1.3.2 Application to a New Server

php,cakephp,cakephp-1.3

Your first error is because /home/SOME_NAME/public_html/OLD_DOMAIN_NAME/tmp/cache/ is not writeable. Make sure that tmp has the correct file permissions; it needs to be writeable by the web server user. Otherwise your issue appears to be that the database config is wrong so the app cannot connect to the database. Check app/config/database.php...

Cakephp How to add two data items to empty option

cakephp-1.3

the following code adds N/A option echo $this->Form->input('dob', array('type' => 'date', 'empty' => array('Select','N/A'), 'label' => 'Birthday', 'dateFormat' => 'MDY', 'minYear' => date('Y') - 120, 'maxYear' => date('Y'), 'selected' => array('month' => '','day' => '', 'year' => '')));...

i18n cakephp 1.3 internatialization

cakephp,internationalization,cakephp-1.3

There shouldn't be any HTML markup in the string you want to translate. So you want to put your <span> tags in the replacement text:- <?= sprintf( __('bla bla bla %s bla', true), '<span id="count">' . $count . '</span>' ); ?> This will give you bla bla bla %s bla...

Inserting new row instead of Updating

cakephp,cakephp-2.0,cakephp-1.3,cakephp-2.3

It looks like you are trying to update a record in your Client model based on the email and client type because (I assume) you don't know the id. Try changing your code to get the id based on the information you have- public function editProfile(){ if($this->request->is('get')) { if (isset($this->data)){...

Which php version does the cakephp 1.3.2 support? Our team wanted to use php 5.6 [closed]

php,cakephp,cakephp-1.3,lamp

The required PHP version is: PHP 4.3.2 or greater Please see the official site to see any other requirement: http://book.cakephp.org/1.3/en/The-Manual/Developing-with-CakePHP/Requirements.html...

Effective management of data changes

php,mysql,cakephp,database-design,cakephp-1.3

It sounds like you're trying to implement a Temporal Database. Temporal support was one of the major additions to the ANSI/ISO SQL:2011 standard. MySQL (like most RDBMS) lags behind the standard. Think of Temporal Database as the DBMS equivalent of CVS/SVN/Git. By contrast, the traditional database we use without temporal...

SQLSTATE[42000]: Syntax error or access violation: 1066 Not unique table/alias

cakephp,cakephp-2.0,cakephp-1.3,cakephp-2.1,cakephp-2.3

First you have to unbindModel because you are already bind Employee model in Store model that's why it conflict with your Model. public function index(){ $this->Store->unbindModel( array('belongsTo' => array('Employee')), true ); $options=array( 'joins' => array( array( 'table' => 'Employee', 'alias' => 'Employee', 'foreignKey' => true, 'conditions'=> array('Employee.employee_store = Store.store_name') )...

CakePHP 1.3 Find Condition with CONCAT multiple fields Next one hour records

php,mysql,sql,cakephp-1.3,concat

Here is the condition, I found working for me: $conditions = array("CONCAT(`hours`,':',`minutes`) <=" => date('H:i', strtotime('+1 hour')), "CONCAT(`hours`,':',`minutes`) >=" => date('H:i')); Hope it helps to the community members ! Suggestions always welcome....

CakePHP 1.3 - Extract URL GET parameters

php,url,cakephp,get,cakephp-1.3

From the Cakephp 1.3 book: URL: /contents/view/chapter:models/section:associations Mapping: ContentsController->view(); $this->passedArgs['chapter'] = 'models'; $this->passedArgs['section'] = 'associations'; $this->params['named']['chapter'] = 'models'; $this->params['named']['section'] = 'associations'; So you should use: $this->params['named']['name1'] $this->params['named']['name2'] ...

How do I sort or do a find in CakePHP based on deep model associations?

cakephp-1.3,containable

Joins will definitely work but it will be very inefficient if you do not cache your query... Now try this- $options['joins'] = array( array( 'table' => 'role_members', 'alias' => 'RoleMember', 'type' => 'INNER', 'conditions' => array( 'RoleMember.user_id = User.id' ) ), array( 'table' => 'roles', 'alias' => 'Role', 'type' =>...

“Relay access denied” error when sending email using CakePHP 1.3

email,cakephp,cakephp-1.3

It was due to invalid SMTP settings. I have detected it and solved it.

Can't click submit button CakePHP + Bootstrap

twitter-bootstrap,cakephp,cakephp-1.3

Your output code is not good structured. Move echo $this->Form->end(); after last closing div tag </div>...

error in joining table in cakephp

cakephp,cakephp-2.0,cakephp-1.3,cakephp-2.1,cakephp-2.3

$options = array( array( 'table' => 'Employee', 'alias' => 'Employee', 'foreignKey' => true, 'conditions'=> array('Employee.employee_store = Store.store_name') ) ); $coupons = $this->Store->find('all',array( "fields"=>array("Employee.*","Store.*"), "joins"=>$options )); ...

CakePHP returns all data values as data type string

php,cakephp,cakephp-1.3

To be expected CakePHP only returns what the underlying driver returns, as such it is Db-dependent, but if you're observing all values are strings then yes, it should be that way. For example, using the mysql driver results are always returned as strings: <?php mysql_connect("localhost", "user", "pass"); $resource = mysql_query("select...