You are here: RE: [PHP] Howto search in SQL for a specific character? « PHP « IT news, forums, messages
RE: [PHP] Howto search in SQL for a specific character?

Posted by Jay Blanchard on 11/29/05 22:59

[snip]
$v1 = chr(39); //39 is apostrofe

$sql = "SELECT nameOfPedigree FROM tbpedigrees WHERE
SUBSTR(nameOfPedigree,0,1) = $v1";

Why doesn't this work?
[/snip]

Probably because the character set is misinterpreted. What happens when you
echo $v1? Try

$sql = "SELECT nameOfPedigree FROM tbpedigrees WHERE
SUBSTR(nameOfPedigree,0,1) = ''' ";

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация