duanlong4890 2016-10-12 18:04
浏览 32

PHP和MySQL - 获得不需要的重复结果

I am unable to display the correct results on my website. I am using PHP and MySQL. I would consider myself a beginner with PHP and MySQL. I am using the MySQLi procedural method.

Okay, here is the problem I am having.

A user will land on a browse_models.page which displays an assortment of different model thumbnails. When the user clicks on a model thumbnail they are sent to a model_details.page which has a has larger photo of the model along with specific details unique to that particular model.

At the bottom of the model_details.page are thumbnails that represent the update or updates the particular model has done on the website along with the name or names of each model featured in the particular update.

I am sending a GET request with the model_id and update_id from the browse_models.page to the model_details.page. I am able to display all the correct information except for the names of the featured models in a particular update.

If a models has done 2 or more updates and at least 1 of the updates contains 2 or more models, I can't display the correct names with each update.

For example Model A has done 3 updates for the site, update 1, update 2, and update 3. In update 2 ,Model A also appears with Model B.

The result should be: update 1- features: Model A update 2 - features: Model A and Model B update 3 - features: Model A

This is not what I'm getting.

What I'm getting is:

update 1 - features: Model A and Model B update 2 - features: Model A and Model B update 3 - features: Model A and Model B

I know I need to find out what model or models are associated with what update. I am working with a database with 3 tables, updates, models, and updates_models (linking table).

Any help or insight into this issue would be greatly appreciated ...

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?
    • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
    • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
    • ¥500 火焰左右视图、视差(基于双目相机)