Answer the question
In order to leave comments, you need to log in
Why doesn't the search form run the script?
A newbie in this business ....... there is a widget on the site, the same search works. I try to do the same in the menu, it does not work.
<!--Search-->
<div id="msearch" class="msearch">
<form action="javascript: TDMArtSearchmove()" method="post">
<input type="text" id="artnumg" name="" maxlength="40" placeholder="ПОИСК ПО АРТИКУЛУ" class="input" />
<input type="submit" name="" value="" class="submit" />
<script type="text/javascript">
function TDMArtSearchmove(){
var art = $('#artnumg').val();
if(art!==''){
art = art.replace(/[^a-zA-Z0-9.-]+/g, '');
location = '/autoparts/search/'+art+'/';
}
}
$('#artnumg').keypress(function (e){
if(e.which === 13){ TDMArtSearchmove(); return false;}
});
</script>
</form>
</div>
<!--end search-->
Answer the question
In order to leave comments, you need to log in
Look in firebug for errors and then ask a question. And from what you cited above, nothing is clear to anyone.
Issue this query in the console, prefixing it with the EXPLAIN command . Get a query plan, see where and what indexes are used, where they need to be added.
I don’t understand what’s wrong with users, I
can remove two joins:
LEFT JOIN users us1 ON us1.id = a.userCreated
LEFT JOIN users us2 ON us2.id = a.userDogovor
LEFT JOIN users us3 ON us3.id = a.userComplete
=>
LEFT JOIN users us1 ON us1.id IN (a.userCreated, a.userDogovor, a.userComplete)
MYSQL joins tables through inner loops. Such a number of joins is deadly. Maybe you should consider denormalizing the data?
Vyacheslav Belyaev , if you work in PHP, create one Questionary class with the getQuestionary() method
and then use it like this, pass the criteria and get the answer:
$questionaryObj= Questionary->getQuestionary(array(
'status' => 1,
'delete' => 0,
));
foreach($questionaryObj as $questionary) {
$clientObj= Client->getClient(array('cliendId' => $questionary->cliendId));
$serviceObj= Service->getService(array('serviceId' => $questionary->serviceId));
$meetObj= Meet->getMeet(array('meetId' => $questionary->meetId));
$userCreatedName = User->getUser(array('userCreated' => $questionary->userId));
$userDogovorName = User->getUser(array('userDogovor' => $questionary->userDogovor));
$userCompleteName = User->getUser(array('userComplete' => $questionary->userComplete));
$responceArr = array(
'name' => $clientObj->name,
'lastname' => $clientObj->lastname,
'patronymic' => $clientObj->patronymic,
'phone' => $clientObj->phone,
'serviceName' => $serviceObj->name,
'meet' => $meetObj->meet,
'wasMeet' => $meetObj->wasMeet,
'dateMeet' => $meetObj->dateMeet,
'serviceName' => $serviceObj->name
);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question