Getting error with sql server database

Hi Every one

I am switching to sql server from mysql database. The new database is same as previous database. But in create user action i am getting this type of error.

include( .php) [<a href=‘function.include’>function.include</a>]: failed to open stream: No such file or directory

C:\wamp\www\yii_main\framework\YiiBase.php(423)

411 foreach(self::$_includePaths as $path)

412 {

413 echo $classFile=$path.DIRECTORY_SEPARATOR.$className.’.php’;

414

415 if(is_file($classFile))

416 {

417 include($classFile);

418 break;

419 }

420 }

421 }

422 else

423 include($className.’.php’);

424 }

425 else // class name with namespace in PHP 5.3

426 {

427 $namespace=str_replace(’\\’,’.’,ltrim($className,’\\’));

428 if(($path=self::getPathOfAlias($namespace))!==false)

429 include($path.’.php’);

430 else

431 return false;

432 }

433 return class_exists($className,false) || interface_exists($className,false);

434 }

435 return true;

Stack Trace

#0

  • C:\wamp\www\yii_main\framework\YiiBase.php(423): YiiBase::autoload()

#1

  • C:\wamp\www\yii_main\framework\YiiBase.php(298): YiiBase::autoload(" ")

#2

  • C:\wamp\www\yii_main\framework\validators\CValidator.php(171): YiiBase::import(" ", true)

#3

  • C:\wamp\www\yii_main\framework\base\CModel.php(285): CValidator::createValidator(" ", YumProfile, "firstname", array("message" => " "))

#4

  • C:\wamp\www\yii_main\framework\base\CModel.php(259): CModel->createValidators()

#5

  • C:\wamp\www\yii_main\framework\base\CModel.php(544): CModel->getValidators()

#6

  • C:\wamp\www\yii_main\framework\base\CModel.php(466): CModel->getSafeAttributeNames()

#7

  • C:\wamp\www\yii_main\framework\base\CComponent.php(153): CModel->setAttributes(array("email" => "", "firstname" => "", "lastname" => "", "street" => "NULL", …))

#8

  • C:\wamp\www\yii_main\framework\db\ar\CActiveRecord.php(160): CComponent->__set("attributes", array("email" => "", "firstname" => "", "lastname" => "", "street" => "NULL", …))

#9

– C:\wamp\www\main_project\protected\modules\user\controllers\YumUserController.php(341): CActiveRecord->__set("attributes", array("email" => "", "firstname" => "", "lastname" => "", "street" => "NULL", …))

336 exit;*/

337

338

339

340 if (Yum::hasModule(‘profile’) && isset($_POST[‘YumProfile’])){

341 $profile->attributes = $_POST[‘YumProfile’];

342 exit;

343 $profile->city = $_POST[‘YumProfile’][‘city’];

344 $profile->firstname = $_POST[‘YumProfile’][‘firstname’];

345 $profile->lastname = $_POST[‘YumProfile’][‘lastname’];

346 $profile->about = $_POST[‘YumProfile’][‘about’];

#10

  • C:\wamp\www\yii_main\framework\web\actions\CInlineAction.php(50): YumUserController->actionCreate()

#11

  • C:\wamp\www\yii_main\framework\web\CController.php(309): CInlineAction->runWithParams(array())

#12

  • C:\wamp\www\yii_main\framework\web\filters\CFilterChain.php(134): CController->runAction(CInlineAction)

#13

  • C:\wamp\www\yii_main\framework\web\filters\CFilter.php(41): CFilterChain->run()

#14

  • C:\wamp\www\yii_main\framework\web\CController.php(1146): CFilter->filter(CFilterChain)

#15

  • C:\wamp\www\yii_main\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(CFilterChain)

#16

  • C:\wamp\www\yii_main\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(CFilterChain)

#17

  • C:\wamp\www\yii_main\framework\web\CController.php(292): CFilterChain->run()

#18

  • C:\wamp\www\yii_main\framework\web\CController.php(266): CController->runActionWithFilters(CInlineAction, array("accessControl"))

#19

  • C:\wamp\www\yii_main\framework\web\CWebApplication.php(276): CController->run("create")

#20

  • C:\wamp\www\yii_main\framework\web\CWebApplication.php(135): CWebApplication->runController("user/user/create")

#21

  • C:\wamp\www\yii_main\framework\base\CApplication.php(162): CWebApplication->processRequest()

#22

– C:\wamp\www\main_project\index.php(14): CApplication->run()

09 defined(‘YII_DEBUG’) or define(‘YII_DEBUG’,true);

10 // specify how many levels of call stack should be shown in each log message

11 defined(‘YII_TRACE_LEVEL’) or define(‘YII_TRACE_LEVEL’,3);

12

13 require_once($yii);

14 Yii::createWebApplication($config)->run();

2012-05-24 06:22:14 Apache/2.2.11 (Win32) PHP/5.3.1 Yii Framework/1.1.9

Can anyone suggest what I can do to resolve this.

problem is showing on this line

$profile->attributes = $_POST[‘YumProfile’];

I have check from code that all objects are working and i am getting of $_POST[‘YumProfile’] value properly.

Thanks in advance,

Abhay

Check the error log and notice that there are no module(table) name - YiiBase::autoload(" “), YiiBase::import(” ", true)- I don’t know why is that… but can give you a starting point in debugging this problem

Could be the case of the table… maybe try first to see if Gii works with the new database…

Hi mdomba,

Thanks for you response. Actually this logic is working properly with a other ‘user’ table and value is inserting, but when i try to insert the data with a form into ‘profile’ table then it shows this type of error. Everything is looking ok from the input but i cant understand why $profile->attributes = $_POST[‘YumProfile’];

this line gives error even profile->validate() and profile->save() also gives this error while $profile->attributes and $_POST[‘YumProfile’] are working properly and filled with proper values.

Thanks in Advanse,

Abhay