﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Релиб / Веб-программирование / PHP  / Запрос с словами, в которых есть апостроф / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>Релиб</description><link>http://relib.com/forums/</link><webMaster>robot@relib.com</webMaster><lastBuildDate>Sun, 07 Sep 2008 23:26:36 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Запрос с словами, в которых есть апостроф</title><link>http://relib.com/forums/Topic913234-17-1.aspx</link><description>Я это делаю так&lt;/P&gt;&lt;P&gt;$P=str_replace("'","&amp;amp;#8242;",$P);</description><pubDate>Fri, 07 Sep 2007 20:07:46 GMT</pubDate><dc:creator>pawww</dc:creator></item><item><title>RE: Запрос с словами, в которых есть апостроф</title><link>http://relib.com/forums/Topic913234-17-1.aspx</link><description>Так же можно воспользоваться [url=http://ru2.php.net/manual/ru/function.mysql-escape-string.php]mysql_escape_string[/url]</description><pubDate>Thu, 09 Aug 2007 18:57:58 GMT</pubDate><dc:creator>van4ous</dc:creator></item><item><title>RE: Запрос с словами, в которых есть апостроф</title><link>http://relib.com/forums/Topic913234-17-1.aspx</link><description>Ты не понял. Чтобы SQL не воспринимал апостроф как спец. символ - его нужно удвоить. Например,&lt;/P&gt;&lt;P&gt;select * from biznesmen where FIO like '%имя''фамилия%'&lt;/P&gt;&lt;P&gt;Обрати внимание на двойной апостроф внутри строки, он будет воспринят как один.&lt;/P&gt;&lt;P&gt;Заменить все апострофы на кавычки можно с помощью функции &lt;A href="http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace"&gt;REPLACE&lt;/A&gt;.</description><pubDate>Mon, 14 May 2007 15:23:38 GMT</pubDate><dc:creator>bazile</dc:creator></item><item><title>RE: Запрос с словами, в которых есть апостроф</title><link>http://relib.com/forums/Topic913234-17-1.aspx</link><description>[quote][b]bazile (14.05.2007)[/b][hr]Заменяй одинарный апостроф двойным.[/quote]&lt;/P&gt;&lt;P&gt;Как это сделать в Mysql через update?</description><pubDate>Mon, 14 May 2007 15:01:32 GMT</pubDate><dc:creator>XXXXXXX</dc:creator></item><item><title>RE: Запрос с словами, в которых есть апостроф</title><link>http://relib.com/forums/Topic913234-17-1.aspx</link><description>Заменяй одинарный апостроф двойным.</description><pubDate>Mon, 14 May 2007 14:17:28 GMT</pubDate><dc:creator>bazile</dc:creator></item><item><title>Запрос с словами, в которых есть апостроф</title><link>http://relib.com/forums/Topic913234-17-1.aspx</link><description>При выполнении запросов типа &lt;/P&gt;&lt;P&gt;select * from `biznesmen` where `FIO` like '%$people[0] $people[1] $people[2]%'&lt;/P&gt;&lt;P&gt;$people[0] $people[1] $people[2] - в этих переменных могут быть апострофи&lt;/P&gt;&lt;P&gt;Дает ошибку You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ясич Андрій Петрович%'' at line 1&lt;/P&gt;&lt;P&gt;Что можно сделать?&lt;/P&gt;&lt;P&gt;Как все записи с апострофом заменить на записи с '' вместо одного апострофа?</description><pubDate>Mon, 14 May 2007 13:36:58 GMT</pubDate><dc:creator>XXXXXXX</dc:creator></item></channel></rss>