Yii Framework Forum: have primary table placeholder? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

have primary table placeholder? Rate Topic: -----

#1 User is offline   jerry2801 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 504
  • Joined: 18-November 09

Posted 07 December 2009 - 04:34 AM

$result = Node::model()->getDbConnection()->createCommand('TRUNCATE TABLE {{Node}}')->execute();


above code can work~

but, {{Node}} is hard code, is not nice~

if can afford primary table placeholder, it will be better~
look like:

$result = Node::model()->getDbConnection()->createCommand('TRUNCATE TABLE <sponsor>')->execute();

0

#2 User is offline   jerry2801 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 504
  • Joined: 18-November 09

Posted 13 December 2009 - 08:51 AM

顶一下~
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users