1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| <?php
$cx = mysql_connect("******","******","******");
if($cx == 0){
?> ERREUR </body></html> <?
exit;
}
$test = mysql_select_db("******");
$order=$_POST['order'];
$type=$_POST['type'];
$date=$_POST['date'];
$style=$_POST['style'];
$nb_votes=$_POST['nb_votes'];
$notation=$_POST['notation'];
if($order=='asc'){$order='ASC';}
else {$order='DESC';}
if($type=='band'){$type='groupe_clip';}
else if($type=='date'){$type='id_clip';}
else if($type=='style'){$type='genre_clip';}
else if($type=='nb_votes'){$type='total_votes';}
else if($type=='notation'){$type='total_value';}
else {$type='titre_clip';}
mysql_query("SET lc_time_names = 'fr_FR'");
$req = "SELECT * FROM md_clip ORDER BY $type $order";
$result = mysql_query($req) or die(mysql_error());
while($data = mysql_fetch_object($result))
{
$titre_clip_cut = substr($data->titre_clip,0,25);
$i = $i+1;
echo "<table style='border-top:1px solid #000; height:40px;'>
<tr>
<td width='50' align='center'>$i</td>
<td width='100'>{$data->date_clip}</td>
<td width='276'>{$data->groupe_clip}</td>
<td width='280'>$titre_clip_cut</td>
<td width='150'>{$data->genre_clip}</td>
<td width='30'>{$data->total_votes}</td>
<td width='30'>{$data->total_value}</td>
<td width='30'>$essai</td>
</tr>
</table>";
}
?> |