Hi i am using php and mysql on my project and i wanted to know which is better (all aspect).
I am expecting a big amount of data in the database.
I want it to search faster.
Should i store the real value or a reference value.
1) Have php proccess it? Meaning I will store values in the database as integer/tinyint and then create a function to know the value to output. ie. if 1 then value is "north" elseif 2 then value is "east" and so on. values will not change.
let say i will have at least 20 of this function.
database design
id direction
1 1 (1=north)
output (use php to display the output)
north
2) Dump all data to database.
database design
id direction
1 north
我应该让php处理它或将所有数据转储到数据库[关闭]
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
3条回答 默认 最新
- duanpuchen3142 2013-08-04 03:12关注
Will the data change overtime, or are they fixed?
If the data can change, better store them in database so you don't have to keep changing your PHP code and just update the data in database as needed.
If the data is fixed, then just store it in PHP. Maybe you can just store it as array and access the record as needed.
$data = array (1 => 'i am one', 2 => 'i am two', 3 => 'etc'); echo "{$data[1]}"; // will output 'i am one'
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 做个有关计算的小程序
- ¥15 MPI读取tif文件无法正常给各进程分配路径
- ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
- ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
- ¥15 setInterval 页面闪烁,怎么解决
- ¥15 如何让企业微信机器人实现消息汇总整合
- ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
- ¥15 如何用Python爬取各高校教师公开的教育和工作经历
- ¥15 TLE9879QXA40 电机驱动
- ¥20 对于工程问题的非线性数学模型进行线性化