Reply to What is the difference between "=>" and "->" operators?

Your name:

Reply:


Posted by mejpark on 08/13/07 10:27

Morning,

I'm currently working my way through a series of tutorials from IBM's
developer network called "Cook up Web sites fast with CakePHP". The
XAMPP 1.4.9 development platform consists of PHP Version 5.0.2, MySQL
3.23.57.

Here is an excerpt of code provided in the tutorial, which is used to
create a model:

<?php
class Dealer extends AppModel
{
var $name = 'Dealer';
var $hasMany = array ('Product' => array(
'className' => 'Product',
'conditions'=>,
'order'=>,
'foreignKey'=>'dealer_id')
);
}
?>


Eclipse produces an error underneath the comma directly after the
'conditions' field, which says:
"Parse error: "Static/scalar constant expected.""

I changed the code above, got it working and continued through the
tutorial:

<?php
class Dealer extends AppModel
{
var $name = 'Dealer';
var $hasMany = array (
"Product" =>
array("className","Product","conditions","order","foreignKey","dealer_id"));
}
?>

The system works fine until I used Bake to implement an ACL. Each time
a new user registers, a rule is supposed to be enterred into the db
which defines what access level they have, but it doesn't work. When a
new user registers a new record should appear in the ACL tables. This
is the only thing that I can think might have caused a problem.

What is the difference between " => " and " -> " in PHP?

Cheers,

Michael

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация