[PHP-MySql] ORDER BY quand plusieurs LIMIT
Résolu
Dominick
-
Dominick -
Dominick -
Bonjour,
Voilà ! J'ai une question à vous poser... je bloque sur des requêtes sql... Ma table à un champ id auto_increment...
Je développe un site web pour mon père, j'ai donc créé une petite album photo, le problème est que les photos s'affiche par l'ordre d'entrer dans la base mysql et je voudrais que ce soit par id... voici le code qui permet l'affichage des images
Voilà ! J'ai une question à vous poser... je bloque sur des requêtes sql... Ma table à un champ id auto_increment...
Je développe un site web pour mon père, j'ai donc créé une petite album photo, le problème est que les photos s'affiche par l'ordre d'entrer dans la base mysql et je voudrais que ce soit par id... voici le code qui permet l'affichage des images
$p = $_GET['p'];
if(empty($p)) { $p = 0; } else { $p = ($p-1)*12; }
$j = ($p);
echo '<tr>';
$ss = ' SELECT * FROM `photos` LIMIT '.$j.', 4';
$ll = mysql_query( $ss );
while($data = mysql_fetch_array($ll))
{
echo '<td width="25%" align="center">
<a href="box.php?width=1000&height=450&pic='.$data['id'].'" class="thickbox" target="_blank" title="Cliquez pour agrandir">
<img src="image.php?width=210&height=300&image='.$data['large'].'" width="186px;"/></a>';
if(admin(cachépoursecurité))
{
echo '<br /><a href="editpicture.php?mod='.$data['id'].'">Modifier</a><br /><a href="editpicture.php?del='.$data['id'].'">Supprimer</a>';
}
echo'</td>';
}
echo '</tr>';
$j = ($p)+4;
echo '<tr>';
$ss = ' SELECT * FROM `photos` LIMIT '.$j.', 4';
$ll = mysql_query( $ss );
while($data = mysql_fetch_array($ll))
{
echo '<td width="25%" align="center">
<a href="box.php?width=1000&height=450&pic='.$data['id'].'" class="thickbox" target="_blank" title="Cliquez pour agrandir">
<img src="image.php?width=210&height=300&image='.$data['large'].'" width="186px;"/></a>';
if(admin(cachépoursecurité))
{
echo '<br /><a href="editpicture.php?mod='.$data['id'].'">Modifier</a><br /><a href="editpicture.php?del='.$data['id'].'">Supprimer</a>';
}
echo'</td>';
}
echo '</tr>';
$j = ($p)+8;
echo '<tr>';
$ss = ' SELECT * FROM `photos` LIMIT '.$j.', 4';
$ll = mysql_query( $ss );
while($data = mysql_fetch_array($ll))
{
echo '<td width="25%" align="center">
<a href="box.php?width=1000&height=450&pic='.$data['id'].'" class="thickbox" target="_blank" title="Cliquez pour agrandir">
<img src="image.php?width=210&height=300&image='.$data['large'].'" width="186px;"/></a>';
if(admin(cachépoursecurité))
{
echo '<br /><a href="editpicture.php?mod='.$data['id'].'">Modifier</a><br /><a href="editpicture.php?del='.$data['id'].'">Supprimer</a>';
}
echo'</td>';
}
echo '</tr>';
echo '</table>';
A voir également:
- [PHP-MySql] ORDER BY quand plusieurs LIMIT
- Easy php - Télécharger - Divers Web & Internet
- Mysql community download - Télécharger - Bases de données
- Photos liked by ne fonctionne plus ✓ - Forum Facebook
- 552 size limit exceeded ✓ - Forum Réseaux sociaux
- Expert php pinterest - Télécharger - Langages