Re: [PHP] inserting ´ in a db



Pick one:
http://si2.php.net/manual/en/function.htmlentities.php
http://si2.php.net/manual/en/function.addslashes.php
http://si.php.net/mysql_escape_string

Aleksandar

Yamil Ortega wrote:
Hi list, good day.



I have a simple script that inserts text on a mysql table, that has a field
named description and the type is text.

Everting works fine, except when I try to insert a text that includes a
simple quote.

For example



Yamil´s car



I send the character string to a variable and then insert into a query. But
the mysql says that something is wrong with the query because the quote
after the l looks like the end of the string, and “s car” doesn`t look like
a valid part of the query.



Can anyone help me out, how to handle this error?



Thanks

Yamil


.



Relevant Pages

  • =?iso-8859-1?Q?inserting_=B4_in_a_db?=
    ... I have a simple script that inserts text on a mysql table, ... I send the character string to a variable and then insert into a query. ... after the l looks like the end of the string, and ?s car? ...
    (php.general)
  • Re: query
    ... Assuming this is a MySQL query... ... Don't quote the column names, they are being treated as literals. ...
    (comp.lang.php)
  • Re: Select count(*) in Oracle and MySQL
    ... The same query in Oracle takes about 6 minutes, ... The MySQL table has no primary key either. ... Interesting how he's changed the original quote from this: ...
    (comp.databases.oracle.server)
  • Re: Select count(*) in Oracle and MySQL
    ... The same query in Oracle takes about 6 minutes, ... The MySQL table has no primary key either. ... attempt to quote the original in his blog post - he's paraphrasing ...
    (comp.databases.oracle.server)
  • Re: Problem with SQL and Recordset
    ... This assumes that the name of the subform control on the parent form is the ... NextSuffix field from the "query" to be entered into the Suffix field on ... Dim mySQL As String ...
    (microsoft.public.access.modulesdaovba)