webscripter
Programmer
I read that the only difference between blob and text type fields is that blob is case sensitive. I'm not comparing any values to the html text that I would like to enter into the field, so I guess text is better. Right?
Another question I have is how do I enter a variable that is full of characters ' and ".
I'm using perl with this code:
my$stmt = "CREATE TABLE IF NOT EXISTS user_templates(purpose VARCHAR(200), name VARCHAR(200) PRIMARY KEY, page TEXT, ext VARCHAR(10))";
$pkg::dbh->do($stmt) || &dberror("Couldn't do the statement $stmt"
my$tmplt_content2 = $tmplt_content;
$tmplt_content2 =~ s@'@\\'@g;
$stmt = "INSERT INTO user_templates (purpose, name, page, ext) values ('$tmplt_pur_val','$tmplt_name_val','$tmplt_content2','$pkg::ext')";
if($DBI::errstr =~ /Duplicate/){
my$replace = "REPLACE INTO user_templates (purpose, name, page, ext) values ('$tmplt_pur_val','$tmplt_name_val','$tmplt_content2','$pkg::ext')";
print STDERR "\n Found Duplicate field";
$pkg::dbh->do($replace) || &dberror("Couldn't do replace because\n"
}if($DBI::errstr =~ /Duplicate/){
my$replace = "REPLACE INTO user_templates (purpose, name, page, ext) values ('$tmplt_pur_val','$tmplt_name_val','$tmplt_content2','$pkg::ext')";
$pkg::dbh->do($replace) || &dberror("Couldn't do replace because\n"
}
This enters something into the field, but when I do this from the prompt window:
mysql>select page from user_templates where name='test';
I get this:
---------------
--------------+
1 row in set (0.06 sec)
Is there a reason I can't view the html in a msdos window?
Thanks
Pat
admin@websiteprogrammin.com
Another question I have is how do I enter a variable that is full of characters ' and ".
I'm using perl with this code:
my$stmt = "CREATE TABLE IF NOT EXISTS user_templates(purpose VARCHAR(200), name VARCHAR(200) PRIMARY KEY, page TEXT, ext VARCHAR(10))";
$pkg::dbh->do($stmt) || &dberror("Couldn't do the statement $stmt"
my$tmplt_content2 = $tmplt_content;
$tmplt_content2 =~ s@'@\\'@g;
$stmt = "INSERT INTO user_templates (purpose, name, page, ext) values ('$tmplt_pur_val','$tmplt_name_val','$tmplt_content2','$pkg::ext')";
if($DBI::errstr =~ /Duplicate/){
my$replace = "REPLACE INTO user_templates (purpose, name, page, ext) values ('$tmplt_pur_val','$tmplt_name_val','$tmplt_content2','$pkg::ext')";
print STDERR "\n Found Duplicate field";
$pkg::dbh->do($replace) || &dberror("Couldn't do replace because\n"
}if($DBI::errstr =~ /Duplicate/){
my$replace = "REPLACE INTO user_templates (purpose, name, page, ext) values ('$tmplt_pur_val','$tmplt_name_val','$tmplt_content2','$pkg::ext')";
$pkg::dbh->do($replace) || &dberror("Couldn't do replace because\n"
}
This enters something into the field, but when I do this from the prompt window:
mysql>select page from user_templates where name='test';
I get this:
---------------
--------------+
1 row in set (0.06 sec)
Is there a reason I can't view the html in a msdos window?
Thanks
Pat
admin@websiteprogrammin.com