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 last

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% URL: http://www.mysql.com/doc/S/t/String_comparison_functions.html -- Roger

Re: help please, patter matching problem

2002-01-12 Thread Douglas Forrest
, 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=?); $sth-execute(%$sname%); $dname = $sth-fetchrow_array; $names is supposed to be a substring. So if I

Re: help please, patter matching problem

2002-01-12 Thread Douglas Forrest
: 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-prepare(SELECT Contacts FROM Info WHERE Name=%$sname%); $sth-execute(); - Original Message - From: Dan [EMAIL