2
I am in great difficulty. I have the following SQL:
$contardescricao = "0";
$sqlxmldescricao = "select id from imoveis where cod = '$cliente'
AND (character_length(descricao)<'10')";
$rsqlxmldescricao = mysql_query($sqlxmldescricao) or die ("Banco XML não abre!");
while($rowxmldescricao = mysql_fetch_array($rsqlxmldescricao))
{
$contardescricao = $contardescricao + 1;
}
I’m trying to get her to check the field descrição
has less than 10 characters.
My interest is to ride inside the sql structure this search to count the field DESCRIPTION of each record.
It is possible?
What’s the problem? Remember that character checking is done on top of a record just because of the
cod = '$cliente'
– rray
@rray understand, but this script does not accurately display how many records there are in the table that have the DESCRICAO field with less than 10 characters. I wanted to make this resource within the SQL structure.
– Gladison Neuza Perosini
When you remove
cod = '$cliente'
and just leave:select id from imoveis where character_length(descricao < '10')
comes true?– rray
@Nothing, it doesn’t work!
– Gladison Neuza Perosini
Does not come any record? tested directly in the database? There is a syntax error ... that passed, the right is:
select id from imoveis where character_length(descricao) < 10
– rray
@rray worked, it was lack of I run straight into the bank. Thank you very much!
– Gladison Neuza Perosini
Creates a response with the details of adapted code.
– rray