Detaylı arama
function funcArastir(){
var araMsg = document.getElementById("aramsg");
$.ajax({
type: "POST",
url: "search.php",
data: $("#arama_formu").serialize(),
success: function(data){
if($.trim(data) == "metin"){
araMsg.innerHTML = 'Anahtar kelime giriniz!...
';
}
}
});
}
}
require_once('config.php');
if($_POST){
$search_query = mysql_real_escape_string($_POST['search_query']);
$search_filter = $_POST['search_filter'];
if($search_query == '' && $search_filter == 'uye' || $search_filter == 'soru'){
echo 'metin';
}elseif($search_filter == 'uye'){
$search_sorgu = mysql_query("SELECT * FROM tbl_users WHERE user_nickname LIKE '$search_query%'");
while($search_data = mysql_fetch_array($search_sorgu)){
echo ''.$search_data['user_firstname'].' '.$search_data['user_lastname'].'
';
}
}else if($search_filter == 'soru'){
$que_sorgu = mysql_query("SELECT * FROM tbl_questions WHERE question_title LIKE '$search_query%'.");
while($que_data = mysql_fetch_array($que_sorgu)){
echo '
'.$que_data['question_title'].'
'.$que_data['question_pubname'].' '.$que_data['question_pubdate'].' '.$que_data['question_category'].' '.$que_data['question_views'].' '.$que_data['question_totalcomments'].'
'.$que_data['question_description'].'
';
}
}
}
?>