简体   繁体   English

php mysql 一对多关系还是别的什么?

[英]php mysql one to many relationship or something else?

I am trying to figure out what to do from here.我试图从这里弄清楚该怎么做。 I am using mysql for my database.我正在为我的数据库使用 mysql。 In my form from mysql I wish to have the possibility for people to upload from 1 to many images that can be queried along with the data submitted in the form.在我的 mysql 表单中,我希望人们可以上传 1 到多张可以与表单中提交的数据一起查询的图像。 I am not asking for someone to write me the code, but to point me in the right direction of what type of solution I can use or what I can read on to learn to get this done.我不是要求某人为我编写代码,而是为我指出正确的方向,即我可以使用什么类型的解决方案,或者我可以阅读什么来学习完成这项工作。

User example here: 1. a registered user is filling out a form for example a car for sale ad.此处的用户示例: 1. 注册用户正在填写表格,例如汽车销售广告。 2. user wishes to upload images relating to that car sale ad. 2. 用户希望上传与该汽车销售广告相关的图片。 3.if the user fills out the car for sale form and clicks submit/next.How to display the form the user just clicked submit in the next page to appear,so the user can add images there/here? 3.如果用户填写了汽车出售表格并点击提交/下一步。如何在下一页显示用户刚刚点击提交的表格,以便用户可以在那里/这里添加图像?

I hope someone can point me in the right direction or can give me their input on what else I can read on to do this.我希望有人能指出我正确的方向,或者可以就我可以阅读的其他内容提供意见。

Thank you in advance先感谢您

Personally when I start having to get into complex HABTM relationships and the what I want to use an ORM.就个人而言,当我开始不得不进入复杂的 HABTM 关系以及我想使用 ORM 时。 I personally use CakePHP's .我个人使用CakePHP 的. It has a very robust relational mapping system (HasMany, HasOne, BelongsTo, HasAndBelongsToMany) which is a bit of a pain to learn to do in SQL your self.它有一个非常健壮的关系映射系统(HasMany、HasOne、BelongsTo、HasAndBelongsToMany),学习用 SQL 自己做这件事有点痛苦。

If you don't have access to a server with the right php modules 3.0 can be a pain to install, but 2.0 has a really nice RubyOnRails style ActiveRecord system too.如果您无法访问具有正确 php 模块的服务器,那么 3.0 安装起来可能会很麻烦,但 2.0 也有一个非常好的 RubyOnRails 风格的 ActiveRecord 系统。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM