Jump to content

php5 parse, syntax ',' error, IBM code


fourcs

Recommended Posts

hi,

I'm using the following IBM tutorial code for cakephp v. 1.2

 

<?php

  class Product extends AppModel

  {

    var $name = 'Product';

    var $belongsTo = array ('Dealer' => array(

'className' => 'Dealer',

'conditions' => ,

'order' => ,

'foreignKey' =>'dealer_id'));

  }

?>

 

I'm running slack 12.0, apache 3 and konquerer.

???It's giving me parse, syntax ',' errors on line 7. Can anyone give me some leads?

Thanks

Link to comment
https://forums.phpfreaks.com/topic/118417-php5-parse-syntax-error-ibm-code/
Share on other sites

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

 

----------------

Now playing: Enter Shikari - Mothership (Demo)

via FoxyTunes

class Product extends AppModel {

var $name = 'Product';

var $belongsTo = array ('Dealer' => array ('className' => 'Dealer', 'conditions' => '', 'order' => '', 'foreignKey' =>'dealer_id'));

}

 

That works fine for me :/

 

----------------

Now playing: Enter Shikari - Keep It On Ice (Zane Lowe BBC Session)

via FoxyTunes

I'm on 5.2.4 and it works. Although that shouldn't make a difference. This is PHP4 code. I'm not sure. It works for me. Is that all the code you're using, or is there more you're not showing us? :P

 

----------------

Now playing: Flyleaf - All Around Me

via FoxyTunes

That's all the code in this file, which is used in a cakephp 1.2 app I'm working on.

Can you post the link to the IBM article you're reading. Everything LemonInFlux suggested is vaild code. Can you also provide details how you're running the code too.

Here's the link (they require logging in to see tutorial, hence the https)

 

https://www6.software.ibm.com/developerworks/education/os-php-cake2/section3.html

 

My error is produced at the browser, http://localhost/cake5/products.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.