• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
passing name instead of id

#21
could you tell me the query?
Reply

#22
made some modifications with the query., @Wouter60
Reply

#23
Well, does it work now?
Reply

#24
(10-28-2019, 10:50 AM)Wouter60 Wrote: Well, does it work now?


nope.,
Reply

#25
Photo 
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.