$son_sosyal_cek = $baglanti->query("SELECT * from tbl_sosyal where id = (SELECT max(id) as maxid from tbl_sosyal) and aktif > 0");
$son_sosyal = $son_sosyal_cek->fetch();
$son_sosyal_id = $son_sosyal['id'];
$sosyal_cek = $baglanti->query("SELECT * from tbl_sosyal where id != '$son_sosyal_id'");
while ($sosyal = $sosyal_cek->fetch()) {
echo '
$son_sosyal_cek = $baglanti->query("SELECT * from tbl_sosyal where id = (SELECT max(id) as maxid from tbl_sosyal) and aktif > 0");
$son_sosyal = $son_sosyal_cek->fetch();
$son_sosyal_id = $son_sosyal['id'];
$sosyal_cek = $baglanti->query("SELECT * from tbl_sosyal where id != '$son_sosyal_id'");
while ($sosyal = $sosyal_cek->fetch()) {
echo '