Re: help please, patter matching problem

2002-01-12 Thread Douglas Forrest
PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, January 12, 2002 4:16 PM Subject: Re: help please, patter matching problem > No closing quotes in prepare. > > Also, I've never seen code that's looks quite like that; this may be > cleaner: > > $sth=$dbh->pre

Re: help please, patter matching problem

2002-01-12 Thread Douglas Forrest
ROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, January 12, 2002 9:49 AM Subject: help please, patter matching problem > mysql and Perl > > Can someone tell me what's wrong with this code: > > $sth=$dbh->prepare("SELECT Contacts FROM Info WHERE Name=?); > > $s

RE: help please, patter matching problem

2002-01-12 Thread Roger Baklund
* Dan > Can someone tell me what's wrong with this code: > > $sth=$dbh->prepare("SELECT Contacts FROM Info WHERE Name=?); > > $sth->execute("%$sname%"); You should use the LIKE operator: Name LIKE "%roger%" http://www.mysql.com/doc/S/t/String_comparison_functions.html > -- Roger --

help please, patter matching problem

2002-01-12 Thread Dan
mysql and Perl Can someone tell me what's wrong with this code: $sth=$dbh->prepare("SELECT Contacts FROM Info WHERE Name=?); $sth->execute("%$sname%"); $dname = $sth->fetchrow_array; $names is supposed to be a substring. So if I want to search for a middle name or just a first name or even a