List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:April 26 2002 9:28pm
Subject:Re: mysql_real_query and escaping a semicolon
View as plain text  
>Paul DuBois wrote:
>
>>  At 14:37 -0600 4/26/02, Anna Fowles-Winkler wrote:
>>  >Well, the function is called like this:
>>  >
>>  >mysql_real_query( mysql_connection, query_string, strlen( query_string ));
>>  >
>>  >Wouldn't that pass the correct length?
>>
>>  Not necessarily.
>
>Uhm... why not?  Wouldn't strlen return the length of the string, ie, the
>number of characters, and wouldn't that be the length in bytes?
>
>--Anna

Because mysql_real_query() allows the possibility that the query
string contains binary data (including null bytes), in which case
strlen() won't necessarily be correct.

*IF* the query string doesn't have anything like that in it,
then your call should work.  I just find it hard to believe that
a semicolon would cause any problem.
Thread
mysql_real_query and escaping a semicolonAnna Fowles-Winkler26 Apr
  • Re: mysql_real_query and escaping a semicolonPaul DuBois26 Apr
  • Re: mysql_real_query and escaping a semicolonAnna Fowles-Winkler26 Apr
    • Re: mysql_real_query and escaping a semicolonPaul DuBois26 Apr
  • Re: mysql_real_query and escaping a semicolonAnna Fowles-Winkler26 Apr
    • Re: mysql_real_query and escaping a semicolonPaul DuBois26 Apr
  • Re: mysql_real_query and escaping a semicolonAnna Fowles-Winkler26 Apr
  • Re: mysql_real_query and escaping a semicolonAnna Fowles-Winkler26 Apr
  • Re: mysql_real_query and escaping a semicolonGerald Clark29 Apr
  • Re: mysql_real_query and escaping a semicolonAnna Fowles-Winkler29 Apr
    • Re: mysql_real_query and escaping a semicolonPaul DuBois29 Apr
  • Re: mysql_real_query and escaping a semicolonAnna Fowles-Winkler29 Apr
    • Re: mysql_real_query and escaping a semicolonMichael Widenius30 Apr