Welcome Guest, Not a member yet? Register   Sign In
passing name instead of id
#25
Photo 
(This post was last modified: 12-28-2019, 06:00 PM by wdeda.)

My knowledge is limited, a hobby, but it is not possible to search by name because the content in the table field is variable, to be by genre it would be necessary to have a field in the table for each genre, which would complicate the relationship with the movie. The purpose of your site is different from mine not to mention that in my case besides movies I have music albums. The search could be album, music, names (bands, actors, singers, directors, etc.). Of course it could also be genre but then it would get complicated, because records have genres, but different from movies.

For both movies and albums the idea is as follows:

Movies
Only three genres appear on each movie page:

Genre: Drama | Biography | Music

Drama is the primary genre - what really characterizes the movie -
Biography -> Secondary
Music -> Tertiary

When, for example, you click on "drama", all movies are listed where "drama" is the primary genre and so on for the other genres.

Model:

public function get_genre1($per_pg, $offset)
{
$query = $this->db
->select('*)
->from('movies')
->where('id', $id)
->get();

foreach($query->result() as $row);
$genre1 = $row->genre1;

$query = $this->db
->select('*')
->from('movies')
->where('genre1', $genre1)
->order_by('title', 'ano', 'asc')
->get('movies', $per_pg, $offset);
return $query->result();
 ...
Reply


Messages In This Thread
passing name instead of id - by manigopal - 10-23-2019, 08:39 PM
RE: passing name instead of id - by Wouter60 - 10-24-2019, 05:05 AM
RE: passing name instead of id - by manigopal - 10-24-2019, 05:31 AM
RE: passing name instead of id - by Wouter60 - 10-24-2019, 06:26 AM
RE: passing name instead of id - by manigopal - 10-25-2019, 10:26 AM
RE: passing name instead of id - by manigopal - 10-25-2019, 07:58 PM
Added Pagination - by manigopal - 10-25-2019, 11:59 PM
RE: passing name instead of id - by Wouter60 - 10-26-2019, 01:30 AM
RE: passing name instead of id - by manigopal - 10-26-2019, 01:44 AM
RE: passing name instead of id - by Wouter60 - 10-26-2019, 01:58 AM
RE: passing name instead of id - by manigopal - 10-26-2019, 02:01 AM
RE: passing name instead of id - by Wouter60 - 10-26-2019, 02:30 AM
RE: passing name instead of id - by manigopal - 10-26-2019, 07:18 AM
RE: passing name instead of id - by Wouter60 - 10-26-2019, 08:48 AM
RE: passing name instead of id - by manigopal - 10-26-2019, 09:02 AM
RE: passing name instead of id - by manigopal - 10-26-2019, 10:24 PM
RE: passing name instead of id - by manigopal - 10-27-2019, 01:07 AM
RE: passing name instead of id - by Wouter60 - 10-27-2019, 04:48 AM
RE: passing name instead of id - by manigopal - 10-27-2019, 07:16 AM
RE: passing name instead of id - by Wouter60 - 10-27-2019, 07:44 AM
RE: passing name instead of id - by manigopal - 10-27-2019, 08:04 AM
RE: passing name instead of id - by manigopal - 10-28-2019, 03:27 AM
RE: passing name instead of id - by Wouter60 - 10-28-2019, 10:50 AM
RE: passing name instead of id - by manigopal - 10-28-2019, 10:21 PM
RE: passing name instead of id - by wdeda - 12-28-2019, 05:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB