in reply to Avoiding duplicate filenames
$filename = $dateadded."-" . join("-",@words) . ".html"; $filename_base = $filename; $filename_base =~ s/\.html//g; # check to see if filename is being used $SQL = "SELECT * FROM $database_table WHERE filename = '$filename' +"; &Do_SQL;
In other words: Use placeholders! Always.
http://bobby-tables.com/perl explains how.
(And get rid of abusing global variables as parameters for functions, and calling functions with an '&' prefix. Both is considered bad style, and both may have unwanted side effects.)
Alexander
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Avoiding duplicate filenames
by htmanning (Friar) on Sep 25, 2018 at 23:38 UTC |