简体   繁体   中英

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. 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. 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. 2. user wishes to upload images relating to that car sale ad. 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?

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. I personally use CakePHP's . 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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