Tutaj kod zaawansowanego:
<?php case 'advanced'<span style="color: #007700": { if ($_POST['City'] != "") {$City = "= '".$_POST['City']."'";} else {$City = "LIKE '%%'";} if ($_POST['Sex'] == "men") {$Sex = "='M'";} elseif ($_POST['Sex'] == "women") {$Sex = "='F'";} else {$Sex = "LIKE '%%'";} if ($_POST['Sort'] == "ostatnia aktywność") { $Sort = 'UserLastActive'; } elseif ($_POST['Sort'] == "najnowsze zdjęcie") {$Sort = 'UserLastPhoto';} elseif ($_POST['Sort'] == "po średniej") {$Sort = 'UserAverageMark';} elseif ($_POST['Sort'] == "alfabetycznie") {$Sort = 'UserNick';} if ($_POST['MinHeight'] != "-") { $MinHeight = substr($_POST['MinHeight'],0,3);} else {$MinHeight = 0;} if ($_POST['MaxHeight'] != "-") { $MaxHeight = substr($_POST['MaxHeight'],0,3);} else {$MaxHeight = 230;} if ($_POST['HairColor'] != "dowolny") {$HairColor = "= '".$_POST['HairColor']."'";} else {$HairColor = "LIKE '%%'";} if ($_POST['HairLength'] != "dowolna") {$HairLength = "= '".$_POST['HairLength']."'";} else {$HairLength = "LIKE '%%'";} if ($_POST['EyesColor'] != "dowolny") {$EyesColor = "= '".$_POST['EyesColor']."'";} else {$EyesColor = "LIKE '%%'";} if ($_POST['Smoke'] != "dowolnie") {$Smoke = "= '".$_POST['Smoke']."'";} else {$Smoke = "LIKE '%%'";} if ($_POST['Alcohol'] != "dowolnie") {$Alcohol = "= '".$_POST['Alcohol']."'";} else {$Alcohol = "LIKE '%%'";} if ($_POST['Education'] != "dowolne") {$Education = "= '".$_POST['Education']."'";} else {$Education = "LIKE '%%'";} if ($_POST['Children'] != "dowolnie") {$Children = "= '".$_POST['Children']."'";} else {$Children = "LIKE '%%'";} if ($_POST['GG'] != "GG") {$GG = "LIKE '%%'";} else {$GG = "!= '' AND UserHideGG = 'No'"; } if ($_POST['Skype'] != "Skype") {$Skype = "LIKE '%%'";} else {$Skype = "!= '' AND UserHideSkype = 'No'"; } $DB = new Engine( DBHOST, DBADMIN, DBPASS, DBNAME ); if ( $DB->IsConnected ) { $DB->Query("SELECT FROM Users WHERE UserGG ".$GG." AND UserSkype ".$Skype." AND UserLocCity ".$City." AND UserBirthDate BETWEEN '$AgeMax' AND '$AgeMin' AND UserSex ".$Sex." AND UserHairColor ".$HairColor." AND UserHairLength ".$HairLength." AND UserEyesColor ".$EyesColor." AND UserSmoke ".$Smoke." AND UserAlcohol ".$Alcohol." AND UserEducation ".$Education." AND UserChildren ".$Children." AND UserHeight BETWEEN '$MinHeight' AND '$MaxHeight' ORDER BY ".$Sort.";"); $Records = $DB->NRows(); $Photos = 10; if ($Records == 1) { while ($Row = $DB->FetchArray()) { HREF("profile.php?id=".$Row['UserID']); } } elseif($Records > 1) { $_GET['subpage'] = 1; } $Start = ($_GET['subpage']-1)*$Photos; $Temp = 0; if($_GET['subpage']>1) echo '<td><a href="search.php?method=advanced&subpage='.($_GET['subpage']-1).'">Poprzednia</a></td>'; if($subpages<=10) { for ($s=1; $s<=$subpages; $s++){ } elseif($subpages>10) { if($next>=6 && $_GET['$subpage']<=$subpages-5){ $wr=$_GET['subpage']-4; $wz=$_GET['subpage']+5; for ($s=$wr; $s<=$wz; $s++){ } } else if($_GET['subpage']>=$subpages-5){ for ($s=$subpages-9; $s<=$subpages; $s++){ } } else{ for ($s=1; $s<=10; $s++){ } } if($_GET['subpage']<$subpages) echo '<td><a href="search.php?method=advanced&subpage='.($_GET['subpage']+1).'">Następna</a></td>'; $DB->Query("SELECT * FROM Users WHERE UserGG ".$GG." AND UserSkype ".$Skype." AND UserLocCity ".$City." AND UserBirthDate BETWEEN '$AgeMax' AND '$AgeMin' AND UserSex ".$Sex." AND UserHairColor ".$HairColor." AND UserHairLength ".$HairLength." AND UserEyesColor ".$EyesColor." AND UserSmoke ".$Smoke." AND UserAlcohol ".$Alcohol." AND UserEducation ".$Education." AND UserChildren ".$Children." AND UserHeight BETWEEN '$MinHeight' AND '$MaxHeight' ORDER BY ".$Sort." LIMIT $Start,$Photos;"); while ( $Row = $DB->FetchArray() ) { if ($Row['UserHideEmail'] == "Yes") { $Row['UserEmail'] = 'Ukryty'; } if ($Row['UserHideGG'] == "Yes") { $Row['UserGG'] = 'Ukryty'; } if ($Row['UserHideSkype'] == "Yes") { $Row['UserSkype'] = 'Ukryty'; } $Temp++; echo '<div style="alig:center;overflo:hidden;border: 1px #ff7400 dashed;floa:left;widt:202px;"> <div width="200"><b>'.$Row['UserNick'].'</b> '.ChooseSex($Row['UserSex']).' <b>'.$Row['UserAverageMark'].'</b></div>'; echo '<div width="200"><img src="profiles/'.$Row['UserID'].'/photos/mini/'.$Row['UserPhotoDefault'].'.jpg" alt="" /></div>'; </div>'; } } break;} ?>
Nie działa, jeśli nacisnę na 2 stronę wyskakuje błąd:
"Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/teodor/public_html/konto/engine.class.php on line 85
Nie znaleziono osoby odpowiadającej podanym kryteriom. "
Prosze nie pisać, że może funkcja ta jest zła, bo zawsze i wszedzie chodziła, problem może być z zapytaniem.
Proszę o pomoc