Hi.
Ive been programming a search form with three fields, and the one thatt is giving me troubles is the one that use "LIKE" clause in sql.
Here is the code:
<form method="post" action="<?php $_SERVER['PHP_SELF']?>">
<p>
<label for="nome">Nome Empresa:</label>
<input type="text" name="nome" id="nome"/>
<label for="concelho">Concelho:</label>
<select name="concelho">
<option id="" selected="selected" value="">Seleccione o Concelho</option>
<option value="1" id="1">Um</option>
<option value="2" id="1">Dois</option>
</select>
<label for="actividade">Actividade:</label>
<select name="actividade">
<option id="" selected="selected" value="">Seleccione a actividade</option>
<option value="1" id="1">Actividade Um</option>
<option value="2" id="1">Actividade Dois</option>
</select>
</p>
<p>
<input type="submit" name="pesquisar" value="Pesquisar"/>
</p>
</form>
// the sql (not all)
$nome = mysql_real_escape_string($_POST['nome']);
// Pesquisa a partir da form
if (isset($_POST['pesquisar'])) {
$queryStr = 'SELECT * FROM ';
if(!empty($nome)){
$queryStr .= 'tbl_clientes WHERE nome LIKE '%'$nome'%'';
}
Why it gives me two times, this error?
Warning: Division by zero in .. on line ..
Warning: Division by zero in .. on line ..
I'm not making a Division...am i??
Thanks in advance