7 messages in com.mysql.lists.perlQuoting problem| From | Sent On | Attachments |
|---|---|---|
| Alec Smith | 02 Mar 2001 04:04 | |
| Brock Murch | 02 Mar 2001 05:19 | |
| Jay Lawrence | 02 Mar 2001 07:50 | |
| ed phillips | 02 Mar 2001 07:51 | |
| ed phillips | 02 Mar 2001 09:07 | |
| ja...@lawrence.net | 02 Mar 2001 10:17 | |
| ed phillips | 02 Mar 2001 10:52 |
| Subject: | Quoting problem![]() |
|---|---|
| From: | Alec Smith (al...@shadowforum.net) |
| Date: | 03/02/2001 04:04:27 AM |
| List: | com.mysql.lists.perl |
The below code snippet works perfectly for me:
$query = $db->prepare("SELECT 'member_id','username','password' FROM profiles where username=\'$post{'username'}\'"); $query->execute; $result_rows = $query->rows;
if ($result_rows != 0) { $result = $query->fetchrow_arrayref;
if (($result->[1] eq $post{'username'}) && ($result->[2] eq $post{'password'})) { $member_id = $result->[0]; } else { No match found code } }
However
$post{'username'} = $db->quote($post{'username'}); $query = $db->prepare("SELECT 'member_id','username','password' FROM profiles where username=$post{'username'}"); $query->execute; $result_rows = $query->rows;
if ($result_rows != 0) { $result = $query->fetchrow_arrayref;
if (($result->[1] eq $post{'username'}) && ($result->[2] eq $post{'password'})) { $member_id = $result->[0]; } else { no match found code }
results in the else{ ... } clause being executed. Any ideas why? I'm lost... I'm running under Apache/1.3.24+mod_perl-1.24+DBI-1.14+perl-DBD-msql-mysql-1.2214
Any tips are much appreciated....
Alec




