Coder Social home page Coder Social logo

Comments (13)

billge1205 avatar billge1205 commented on May 1, 2024

Biny中没有sql文件这个概念 只需要在/app/config/dns_{env}.php(链接配置)中将数据库库信息配置好即可 表的话需要在dao目录下建立dao文件 或者 在/config/database.php 中建立表映射
初始代码中 应该没有sql语句 如果是你自己写的代码 可以在wiki中看看用法 http://www.billge.cc/#dao 有不清楚的我会解答

from biny.

geekdawns avatar geekdawns commented on May 1, 2024

我是不是可以这样理解,需要先自建表,然后“在/app/config/dns_{env}.php(链接配置)中将数据库库信息配置好即可 表的话需要在dao目录下建立dao文件 或者 在/config/database.php 中建立表映射”

from biny.

billge1205 avatar billge1205 commented on May 1, 2024

恩 是的

from biny.

geekdawns avatar geekdawns commented on May 1, 2024

OK,我创建试试。

from biny.

rjzou avatar rjzou commented on May 1, 2024

我建 了Biny_User 表,/login报错 什么问题?

Fatal error: method [updateByPk] not exists in [biny\lib\TXSingleDAO] in /Users/rjzou/workspace/php/Biny/lib/models/TXDAO.php:459 Stack trace: #0 /Users/rjzou/workspace/php/Biny/app/model/person.php(64): biny\lib\TXDAO->__call('updateByPk', Array) #1 /Users/rjzou/workspace/php/Biny/app/controller/loginAction.php(31): app\model\person->login() #2 [internal function]: app\controller\loginAction->action_index() #3 /Users/rjzou/workspace/php/Biny/lib/business/TXController.php(69): call_user_func_array(Array, Array) #4 /Users/rjzou/workspace/php/Biny/lib/business/TXController.php(42): biny\lib\TXController->call(Object(biny\lib\TXRequest)) #5 /Users/rjzou/workspace/php/Biny/lib/business/TXController.php(105): biny\lib\TXController->execute() #6 /Users/rjzou/workspace/php/Biny/lib/TXApp.php(177): biny\lib\TXController->dispatcher() #7 /Users/rjzou/workspace/php/Biny/web/index.php(21): TXApp::run() #8 {main}

from biny.

billge1205 avatar billge1205 commented on May 1, 2024

@rjzou class userDAO extends baseDAO
DAO文件需要自己创建或者配置映射关系
updateByPK用到数据库缓存的方法都在baseDAO里

from biny.

rjzou avatar rjzou commented on May 1, 2024

desc biny_user;
+----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| id | int(11) | NO | PRI | NULL | |
| username | varchar(45) | YES | | NULL | |
+----------+-------------+------+-----+---------+-------+
2 rows in set (0.00 sec)

class userDAO extends baseDAO
{
protected $table = 'Biny_User';
protected $_pk = 'id';
protected $_username = 'username';
protected $_pkCache = true;
}

是这样映射吗?我接下来应该怎么使用?

from biny.

rjzou avatar rjzou commented on May 1, 2024

[ERROR]2018-09-30 10:33:00:936[::1] /favicon.ico
ERROR CODE: 2001
Action[favicon.icoAction] is not exists.

我新建了testDAO,和在config/database.php

return array(
'dbConfig' => array(
'test' => 'Biny_Test',
'user' => 'Biny_User'
)
);
Biny_Test表也建好了。
访问http://localhost:8080/test 还有这个错误?

from biny.

billge1205 avatar billge1205 commented on May 1, 2024

@rjzou 有userDAO.php文件就不需要在config里配置映射了
配置只是为了只需要基础功能的DAO而不想创建文件时准备的
另外 映射的DAO对象不包含baseDAO中提供的pk方法

具体DAO使用方法可以参考wiki: http://www.billge.cc/#dao-simple

from biny.

billge1205 avatar billge1205 commented on May 1, 2024

[ERROR]2018-09-30 10:33:00:936[::1] /favicon.ico
ERROR CODE: 2001
Action[favicon.icoAction] is not exists.

这个是因为服务器自己去找网站图标时候报错了 在/web/目录下放一个favicon.ico图标文件就行
default
其实就是这个

from biny.

rjzou avatar rjzou commented on May 1, 2024

谢谢,test可以查询出来了。

再问一下,修改了php文件要重启apache 才生效?

from biny.

billge1205 avatar billge1205 commented on May 1, 2024

不用 可能是你apache有缓存吧 看下配置把缓存关了吧
正常apache是不需要重启的

from biny.

rjzou avatar rjzou commented on May 1, 2024

修改php.ini opcache.enable=0 可以了。many thanks

from biny.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.