Solved =)


From: "Quentin Bennett" <[EMAIL PROTECTED]>
Have you tried turning on the logging on the MySQL server, and seeing
exactly what command the server is receiving - it may be different from the
one (you
think) you are sending.

   Turning on the logging on the MySQL server, I saw PHP didn't send to
mysql server the final part (which contain WHERE id = 5) of the command
string $command. But when I echo'ed the $command to the browser, WHERE id =
5 was there. So, likely, the string $command hold the trouble. When I tried
*trim the string $value before execute mysql_query("UPDATE ... $value WHERE
id = $i") it worked. Why? On line 54 of
http://www.spalha.com.br/spalha/insert_client_code.html it is inserted the
char "\0" to the string $value, that will be interpolated to the $command,
and this char ('', or NULL) prevents mysql api of the PHP from send the rest
of the string to the sever.

   Solution:     1) Insert ' ' to $values instead ''.
                   OR
                     2) trim $values before interpolate it in $command.

* function trim() in PHP removes some especials chars (" ", "\t", "\0", ...)
from begin end end of the string.

   I don't know if I was clear, but hope to be explained well the solution.
   In two words, the problem was in my PHP script: a NULL char (ascii 0)
inside the string passed to mysql_query($command), which prevented final
part of the commnad, contained the WHERE, to be read.

   Thanks very much to all Sherlocks and Watsons who helped me solve it =)




   Tom


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

Reply via email to