Jump to content

salasis

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

salasis's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ahhh, i see, thankyou very much :D
  2. Thanks, but thats kinda confusing lol.... I found this on the internet: [code]  function processMoviesOrder($key)     {         if (!isset($_POST[$key]) || !is_array($_POST[$key]))             return;         $movies = getMovies();         $queries = array();         $ranking = 1;         foreach ($_POST[$key] as $movie_id) {             if (!array_key_exists($movie_id, $movies))                 continue;             $query = sprintf('update movies set ranking = %d where movie_id = %d',                              $ranking,                              $movie_id);             mysql_query($query);             $ranking++;         }     }[/code] But its confusing as well lol.
  3. Hi there, It may seem a bit vaque but i would be REALLY grateful if you could help me in this. I would like to be able to set the order in which results display: e.g. Result 1 Result 2 Result 3 Result 4 Result 5 I would like that so i could decide in which order it displays. e.g so i could do this: Result 4 Result 2 Result 5 Result 1 Result 3 So i know its basically just adding another field and caling it something like "order" and just updating it to what i want. BUT my question is.... If the table stands as this: [b]Name:[/b] Result 1 [b]Ord:[/b] 4 [b]Name:[/b] Result 2 [b]Ord:[/b] 3 [b]Name:[/b] Result 3 [b]Ord:[/b] 2 [b]Name:[/b] Result 4 [b]Ord:[/b] 1 [b]Name:[/b] Result 5 [b]Ord:[/b] 5 (So i would just use [i]SELECT * FROM `table` ORDER BY `Ord` DESC[/i]) But when i update it say, using a form. The values are gona conflict...(if that makes sence). E.g When i change [b]Result 3[/b] to have a [b]Ord[/b] value of [b]1[/b], Result 4, will already have a Ord value of 1. So both need to change, but after 4 changes, another one will have to change etc etc.... Please help if you can, thankyou!.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.