I
I
iuegfiewug2015-10-23 16:36:59
PHP
iuegfiewug, 2015-10-23 16:36:59

Php Mysql output actors from db. Kinopoisk?

Hello guys, tell me how to display actors from the database by id if there are 2 million records in the database? And how film search so displays actors, directors and screenwriters, for example, and shares. I think it can be solved like this, output
SELECT * FROM actors
We have an array of data and what to do next? If foreach does not perceive, it requires a lot of RAM and this is unrealistic. I can just imagine, but I can't figure out how.
In the database, for example, the film directors are stored like this, as 1,2,3,4,5,6well as actors and screenwriters. How to solve, please help?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey, 2015-10-23
@iuegfiewug

You need a separate, linking, table, which will have a field pointing to the director's id from the directors table and the movie id from the movies table.
You just store the directors incorrectly (if I understand correctly, you store them separated by commas in one of the fields)

A
Alexander, 2015-10-23
@zlobin

First, learn MySql. If you are not interested, hire someone who understands this. A question the answer.
If you want to get a normal answer, specify the structure of the table or database, give more data

I
iuegfiewug, 2015-10-23
@iuegfiewug

That is, if I understand correctly, it should look like this, creating a new table, for example

<b>old_actors</b>
Структура будет такой id, actors_id, types
id - уникальный ид
actors_id - id актера, режисера, сценариста и тд...
types - id кто такой то есть, directors, actors или scenaryo

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question