草庐IT

database-restore

全部标签

php - 调用未定义的方法 Illuminate\Database\Query\Builder

我是laravel4的新手,在尝试了解DB类中的某些方法时不断遇到同样的错误。CalltoundefinedmethodIlluminate\Database\Query\Builder我在尝试使用“->or_where”、“->order_by”时遇到同样的错误。另一个问题是解析动态方法:->where_name("test")变成`users`where`_name`=test)但如果我尝试这样做->wherename("test")那么一切都很好。 最佳答案 您对orWhere和orderBy使用了错误的语法。这是orWher

php - 在 CodeIgniter 3 中使用 Illuminate/Database Eloquent ORM 进行多数据库连接

我刚刚将Laravel的数据库层Eloquent添加到我的CodeIgniter3项目中。然而,我的问题是我无法使用Eloquent模型连接到多个数据库。对于默认数据库,这是我配置数据库的方式:$capsule=newCapsule;$capsule->addConnection(array('driver'=>'mysql','host'=>"localhost",'database'=>"employees_db",'username'=>"root",'password'=>"",'charset'=>'utf8','collation'=>'utf8_unicode_ci','

php - 代码点火器 2.1.3 : sess_destroy() causes Undefined index: session_id etc notice when 'sess_use_database' == TRUE

我一直在使用数据库测试codeigniter的session功能,每当我注销(使用sess_destroy())时,我都会收到以下通知:APHPErrorwasencounteredSeverity:NoticeMessage:Undefinedindex:session_idFilename:libraries/Session.phpLineNumber:272APHPErrorwasencounteredSeverity:NoticeMessage:Undefinedindex:ip_addressFilename:libraries/Session.phpLineNumber:2

php - 类型错误:传递给 Illuminate\Database\Eloquent\Builder::create() 的参数 1 必须是数组类型,给定为 null

我正在尝试在laravelrestapi中发布标题和文章,但出现此错误Typeerror:Argument1passedtoIlluminate\Database\Eloquent\Builder::create()mustbeofthetypearray,nullgiven,calledinC:\xampp\htdocs\LaravelProject\cpapi\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.phponline1440这是我的帖子数据的route/api.php文件Route::post

php - 调用未定义的方法 Illuminate\Database\Query\Builder::notify() Laravel 5.4

我正在使用Laravel5.4得到上面的errorCalltoundefinedmethodIlluminate\Database\Query\Builder::notify()我遇到过这个解决方案YoumustaddIlluminate\Notifications\NotifiabletraitinUsermodel.(link:CalltoundefinedmethodIlluminate\Database\Query\Builder::notify())即使它不适合我下面是我的Usermodel我还没有为models创建任何文件夹,它的路径是默认的hasMany('App\Pro

php - Symfony2 : Database schema and entities not updating with changed metadata

我在更新Symfony2中的架构时遇到问题。我已经使用doctrine将数据库导入到Symfony2,并在YML中创建了所有ORM文件。我已经根据这个元数据创建了所有实体并且效果很好,但是如果我想使用orm.yml文件更改数据库架构,它不会更新我的数据库,甚至不会在我重新生成实体时更新它们。导入创建了orm.yml文件/src/{name}/{my}bundle/Resources/config/doctrine/metadata/orm/{table}.orm.yml它的创建没有错误。当我这样做时:phpapp/consoledoctrine:schema:update--dump-

database - CakePHP:使用 save() 添加/减去?

我试图通过Cake的save()函数简单地执行以下操作。UPDATEuserSETvalue=value-1不过好像只能设置。它不会理解我传递给它的任何递增或递减的内容,而且互联网上似乎没有人遇到过这个问题。:P即使在浏览基于CakePHP2.0构建的完整软件时,我也发现$this->query()用于增量更新!如果我还没有要设置的值,我真的会这样更新吗?(出现代码如下)$data=array('id'=>uid,'value'=>"Users.value=Users.value-1");$this->User->save($data); 最佳答案

php - Zend 框架 2 : Form bind not setting the values extracted from database

我想使用ZendFramework2为我的应用程序创建一个表单,我已准备好所有内容并且表单正在显示,但我的问题是我无法绑定(bind)来自数据库的初始表单值$myUserDetails=;$form=$form->bind($myUserDetails);//Thisshouldsetthevaluesfortheformtodisplaybutitdoesnt我的显示逻辑很简单如下图$form=$this->form;$form->setAttribute('action',$this->url('',array('action'=>'')));$form->prepare();ec

php - 交响乐 2.8 : How to dynamically set database params based on the hostname

我有100个三级域都指向同一个服务器,我有一个Symfony2.8项目。我需要Symfony能够连接到不同的数据库,具体取决于三级域。我知道我可以创建任意多的环境,但环境的语法更像是:-domainname.com/app_customer1.php/[..]-domainname.com/app_customer2.php/[..]-domainname.com/app_customer3.php/[..]White我想要这个URL结构:-customer1.domainname.com/[..]-customer2.domainname.com/[..]-customer3.dom

php - Firefox 在 Web 应用程序上使用 "restore last session"函数

我想在我自己定制的主页上使用firefox中的“恢复上次session”功能。我只是找不到有关如何使用该功能的任何信息,如果可能的话。所以:是否可以在网页上使用恢复上次session?如果是,怎么样?javascript、php、html? 最佳答案 Firefox的功能不是您可以用网页编写的脚本。不过,您可以使用HTML5存储来保存页面的“状态”并在以后恢复它,但这不是开箱即用的解决方案。您必须自己编写脚本。 关于php-Firefox在Web应用程序上使用"restorelastse