----- Original Message ----- From: "Tom Lobato" <[EMAIL PROTECTED]>
To: <mysql@lists.mysql.com>
Sent: Saturday, April 22, 2006 4:03 AM
Subject: Re: WHERE doesn'r works



From: <[EMAIL PROTECTED]>
you really need to show your php code and the output from an echo of
the update line so that people can try to spot what you're doing wrong.
from what i've seen, people are basically just guessing at the issue
with you saying "tried that, didn't work".

updating mysql records via php code, with a where, works just fine.
i.e., this isn't a php/mysql bug. rather there's something in your code
that's not quite right.

so, show your code, the table (definition and data) that you're trying
to update, and output from appropriate echoing of statements and we can
probably help you figure out your problem.

   Perfectly, I didnt show it before just for dont bore you with so many
code =)

   The echo ouput:
UPDATE clientes SET tipo='r', nome_fantasia='cc', estado='24' WHERE id =
'5'


Most of the time, when I see a column named 'id', it is defined as an integer. If _your_ 'id' column is defined as an integer, then the reason your WHERE clause is failing is very simple: Your WHERE clause is looking for all the rows where the 'id' value is a character-string containing '5', not the integer value 5. In other words, remove the apostrophes on either side of the 5 in the WHERE clause so that it says:

   WHERE id = 5

_not_

   WHERE id = '5'

and your WHERE clause will probably start working just fine.

If your 'id' column is defined as a CHAR, VARCHAR or similar data type, then the apostrophes around the 5 are fine and there is some other problem.

   The php and db structure and data are attacheds.

I don't see them in my copy of the email....

Two infos: 1) Im not a
expert 2) The code is in the beggining of the development, so are too many
uglyness yet =)



Also, just a small note about English grammar since English doesn't appear to be your first language: contractions like 'didnt' and 'dont' should _always_ be spelled with apostrophes. In other words: use don't, not dont; use didn't, not didnt.

Unfortunately, even some people who know only English are starting to spell contractions without the apostrophes but this is always wrong and makes the writer look illiterate. Obviously, we make allowances for those who are relatively new to English but I wanted you to know the right way to handle contractions. I assume you want to write English as well as you can so please don't copy the bad habits of English-speakers who don't have enough education or self-respect to spell their own language correctly.

--
Rhino




--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.4.5/321 - Release Date: 21/04/2006


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to