mysql_fetch_array() expects parameter 1 Hata veriyor ltfen yardım
arkadaşlar hata bu çözemedim 2 gündür sinir etti
*1.hata= Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in public_html/admin/videolar.php on line 179
*2.hata = Warning: mysql_free_result() expects parameter 1 to be resource, boolean given in public_html/admin/videolar.php on line 226
yardımcı olacak kmse ykmu
++++++++
arkadaşlar hata bu çözemedim 2 gündür sinir etti
*1.hata= Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in public_html/admin/videolar.php on line 179
*2.hata = Warning: mysql_free_result() expects parameter 1 to be resource, boolean given in public_html/admin/videolar.php on line 226
Kod:
<?php
function temizle($as) {
return str_replace( '\\', '', $as );
}
include( 'header.php' );
$ara = $_GET['ara'];
$tur = $_GET['tur'];
$islem = $_GET['islem'];
$sil2 = $_GET['sil2'];
if ($islem == 'sil') {
foreach ($_GET['isaret'] as $isaret) {
$row = mysql_fetch_array( mysql_query( 'SELECT resim,etiket,video FROM videolar WHERE id=\'' . $isaret . '\'' ) );
$resim = $row['resim'];
$video = $row['video'];
$etiket = $row['etiket'];
$adresk = 'http://' . $_SERVER['HTTP_HOST'] . '';
$resim = str_replace( $adresk, '..', $resim );
$resimsil = @unlink( $resim );
$video = str_replace( $adresk, '..', $video );
$videosil = @unlink( $video );
$listele = explode( ',', $etiket );
$saybakam = count( $listele ) - 1;
$sayac = 0;
while ($sayac <= $saybakam) {
$kelime = trim( $listele[$sayac] );
mysql_query( 'DELETE FROM etiketler WHERE baslik=\'' . $kelime . '\'' );
++$sayac;
}
mysql_query( 'DELETE FROM videolar WHERE id=\'' . $isaret . '\'' );
mysql_query( 'DELETE FROM yorumlar WHERE konuid=\'' . $isaret . '\'' );
mysqlopt( );
tazele( );
}
}
if ($islem == 'manset') {
foreach ($_GET['isaret'] as $isaret) {
mysql_query( 'update videolar set manset = \'1\' where id=\'' . $isaret . '\'' );
mysqlopt( );
tazele( );
}
}
if ($islem == 'manset2') {
foreach ($_GET['isaret'] as $isaret) {
mysql_query( 'update videolar set manset = \'0\' where id=\'' . $isaret . '\'' );
mysqlopt( );
tazele( );
}
}
if ($islem == 'sil2') {
$row = mysql_fetch_array( mysql_query( 'SELECT resim,etiket,video FROM videolar WHERE id=\'' . $sil2 . '\'' ) );
$resim = $row['resim'];
$video = $row['video'];
$etiket = $row['etiket'];
$adresk = 'http://' . $_SERVER['HTTP_HOST'] . '';
$resim = str_replace( $adresk, '..', $resim );
$resimsil = @unlink( $resim );
$video = str_replace( $adresk, '..', $video );
$videosil = @unlink( $video );
$listele = explode( ',', $etiket );
$saybakam = count( $listele ) - 1;
$sayac = 0;
while ($sayac <= $saybakam) {
$kelime = trim( $listele[$sayac] );
mysql_query( 'DELETE FROM etiketler WHERE baslik=\'' . $kelime . '\'' );
++$sayac;
}
mysql_query( 'DELETE FROM videolar WHERE id=\'' . $sil2 . '\'' );
mysql_query( 'DELETE FROM yorumlar WHERE konuid=\'' . $sil2 . '\'' );
mysqlopt( );
tazele( );
}
$sayfa = $_GET['sayfa'];
echo '<hr class="noscreen" />
<!-- Content (Right Column) -->
<div id="content" class="box">
<h1>Videolar</h1>
';
$gelen_sayfa = (( isset( $_GET['sayfa'] ) && $_GET['sayfa'] != '' ) ? intval( $_GET['sayfa'] ) : 1);
echo '<form action="videolar.php" method="GET" id="search">';
$s_sor = mysql_query( 'SELECT count(id) FROM videolar where manset=\'1\'' );
$satir = mysql_result( $s_sor, 0 );
if ($gelen_sayfa == '1') {
if ('1' <= $satir) {
echo '<p class="msg error">Manşetteki Videolar</p>
';
$sorgu = mysql_query( 'SELECT id,baslik,resim,sef2,sure,izlenme FROM videolar where manset=\'1\'' );
while ($sonuc = mysql_fetch_array( $sorgu )) {
echo '<div class="gallery">
<p>
<label><input type="checkbox" name="isaret[]" value="';
echo $sonuc['id'];
echo '" />
';
echo '<s';
echo 'pan class="smaller">';
echo '<s';
echo 'trong>';
echo $sonuc['baslik'];
echo '</strong></span></label><br />
<a href="http://';
echo $_SERVER['HTTP_HOST'];
echo '/';
echo $sonuc['sef2'];
echo '" target="_blank" rel="lightbox" title="';
echo $sonuc['baslik'];
echo '"><img src="';
echo $sonuc['resim'];
echo '" width="200" height="150" class="gallery-img" alt="" /></a>
<a href="videolar.php?islem=sil2&sil2=';
echo $sonuc['id'];
echo '&ara=';
echo $ara;
echo '&tur=';
echo $tur;
echo '&sayfa=';
echo $sayfa;
echo '" class="ico-delete">Sil</a> <a href="videoduzenle.php?id=';
echo $sonuc['id'];
echo '" class="ico-edit">Düzenle</a> <a href="http://';
echo $_SERVER['HTTP_HOST'];
echo '/';
echo $sonuc['sef2'];
echo '" target="_blank" rel="lightbox" class="ico-show">Git</a>
</p>
</div><!-- /gallery -->
';
}
echo '<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
';
}
}
$s_s = '5';
$limit = '20';
$gelen_sayfa = (( isset( $_GET['sayfa'] ) && $_GET['sayfa'] != '' ) ? intval( $_GET['sayfa'] ) : 1);
$s_sor = mysql_query( 'SELECT count(id) FROM videolar' );
$satir = mysql_result( $s_sor, 0 );
if ($satir == '0') {
echo '<p class="msg info">Şuan sistemde ekli video bulunmamaktadır.</p>
';
}
else {
echo '<p class="msg info">Toplam ';
echo $satir;
echo ' adet video Bulundu !</p>
';
}
mysql_free_result( $s_sor );
if (0 < $satir) {
$baslama = (1 < $gelen_sayfa ? ( $gelen_sayfa - 1 ) * $limit : 0);
$sayfa_kac = $satir / $limit;
$sayfa_sayisi = ($satir % $limit != 0 ? intval( $sayfa_kac ) + 1 : intval( $sayfa_kac ));
$basla = ($baslama <= $satir ? $baslama : 0);
unset( $sayfa_kac );
unset( $baslama );
$sorgu = 'SELECT id,baslik,resim,sef2,sure,izlenme FROM videolar order by id desc limit ' . $basla . ' , ' . $limit;
( $sorgula = mysql_query( $sorgu ) || trigger_error( mysql_error( ), E_USER_ERROR ) );
$i = 1;
$style = '';
while ($sonuc = mysql_fetch_array( $sorgula )) {
$sonuc['baslik'] = mb_substr( $sonuc['baslik'], '0', '25' );
echo '<div class="gallery">
<p>
<label><input type="checkbox" name="isaret[]" value="';
echo $sonuc['id'];
echo '" />
';
echo '<s';
echo 'pan class="smaller">';
echo '<s';
echo 'trong>';
echo temizle( $sonuc['baslik'] );
echo '</strong></span></label><br />
<a href="http://';
echo $_SERVER['HTTP_HOST'];
echo '/';
echo $sonuc['sef2'];
echo '" target="_blank" rel="lightbox" title="';
echo $sonuc['baslik'];
echo '"><img src="';
echo $sonuc['resim'];
echo '" width="200" height="150" class="gallery-img" alt="" /></a>
<a href="videolar.php?islem=sil2&sil2=';
echo $sonuc['id'];
echo '&ara=';
echo $ara;
echo '&tur=';
echo $tur;
echo '&sayfa=';
echo $sayfa;
echo '" class="ico-delete">Sil</a> <a href="videoduzenle.php?id=';
echo $sonuc['id'];
echo '" class="ico-edit">Düzenle</a> <a href="http://';
echo $_SERVER['HTTP_HOST'];
echo '/';
echo $sonuc['sef2'];
echo '" target="_blank" rel="lightbox" class="ico-show">Git</a>
</p>
</div><!-- /gallery -->
';
$style = ($style == '' ? '2' : '');
++$i;
}
echo '<div class="pagination box bottom">
<p class="f-right">';
mysql_free_result( $sorgula );
$hangi_sayfa = (0 < $gelen_sayfa ? $gelen_sayfa : 1);
$alt = $gelen_sayfa - $s_s;
if (( $sayfa_sayisi <= $s_s || $gelen_sayfa <= $s_s )) {
$alt = 1;
}
$ust = ($gelen_sayfa + $s_s < $sayfa_sayisi ? $gelen_sayfa + $s_s : $sayfa_sayisi);
if ('1' < $alt) {
echo '<a href="/admin/videolar.php">1</a> » ';
}
$i = $alt;
while ($i <= $ust) {
if ($i == '1') {
$sayfano = '<a href="/admin/videolar.php">' . $i . '</a>';
}
else {
$sayfano = '<a href="/admin/videolar.php?sayfa=' . $i . '">' . $i . '</a>';
}
echo ($i != $gelen_sayfa ? '' . $sayfano . ' ' : '<a href="" class="pagination-active">' . $i . '</a>');
++$i;
}
echo ' « <a href="/admin/videolar.php?sayfa=' . $sayfa_sayisi . '">' . $sayfa_sayisi . '</a>';
echo ($gelen_sayfa <= $sayfa_sayisi ? '' : '');
}
echo '<input type="hidden" name="ara" value="';
echo $ara;
echo '" />
<input type="hidden" name="tur" value="';
echo $tur;
echo '" />
<input type="hidden" name="sayfa" value="';
echo $gelen_sayfa;
echo '" />
</p>
</div> <!-- /pagination -->
<div class="fix"></div>
<div class="box-02 bottom box">
';
echo '<s';
echo 'trong>Seçilenleri:</strong>
';
echo '<s';
echo 'elect name="islem" class="input-text">
<option value="sil">Sil</option>
<option value="manset">Manşet Yap</option>
<option value="manset2">Manşet Kaldır</option>
</select>
<input type="submit" value="Uygula" />
</form>
</div> <!-- /box-02 -->
</div> <!-- /content -->
</div> <!-- /cols -->
<hr class="noscreen" />
<!-- Footer -->
';
include( 'footer.php' );
echo '</div> <!-- /main -->
</body>
</html>';
?>
++++++++