Forum Moderators: mack
Thanx,
Birdman
And for simpler, (or in Brett's hands, more complicated) cases, a flat file and a cgi based solution is also an option.
I recently started on the PHP/MySQL learning curve, and got started by reading tutorials, buying a fat book, and installing PHP/MySQL on a linux/Apache machine at home for a testing server. Much better to make mistakes in a test environment than on somebody elses server that you share with other folks.
It has been fun.
With access you can write a direct connection to it from a web page in ASP or JSP or PhP, and the host doesn't need to have Access installed. You can just upload the MDB file.
Once you get fluent, you can transfer the data to a mySql.
Congrats tx. Well deserved!
>>what flavor server you have
The xt thing to consider is creating your tables.
>>would start with Access, since you probably already have it installed on your machine.
Yes. And as you have access to MSSQL server you can upgrade to that once your traffic builds or migrate to mySQL as txbakers suggests. Although by the looks of the list you have provided mySQL may not be an option if your host does not support it.
Onya
Woz
There is absolutely nothing wrong with flat file text databases.
Take a good look at your requirements - number of records, number of fields, rights for updating etc. and then decide which flavour to use.
I have a number of flat file databases with a quarter of a million records. I'm using Perl and clever method for indexing the database.
Record search is lightening fast. The databases are small and fit easily into the ram cache.
Ok, my databases are read only so editing or adding records would be slower. But I started off the same as you - looking for a database solution. Many advised MySQL etc. and lots of power hungry, steep learning curve stuff. In the end all I needed was a basic flat file text database of which you will find thousands of examples if you search for those words.
I guess that means it is at least running the CGI script, right?
Here's the script. The instructions said to modify the variables at the top. Maybe that is where the prob is.
#!/usr/bin/perl# Define Variables #
$basedir = '/wwwroot';
$baseurl = 'http://www.mysite.com/';
@files = ('wwwroot/*.html');
$title = "Matt's Script Archive";
$title_url = 'http://www.mysite.com/';
$search_url = 'http://www.mysite.com/search.html';# Done #
############################################################################### Parse Form Search Information
&parse_form;# Get Files To Search Through
&get_files;# Search the files
&search;# Print Results of Search
&return_html;sub parse_form {
# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});# Split the name-value pairs
@pairs = split(/&/, $buffer);foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;$FORM{$name} = $value;
}
}sub get_files {
chdir($basedir);
foreach $file (@files) {
$ls = `ls $file`;
@ls = split(/\s+/,$ls);
foreach $temp_file (@ls) {
if (-d $file) {
$filename = "$file$temp_file";
if (-T $filename) {
push(@FILES,$filename);
}
}
elsif (-T $temp_file) {
push(@FILES,$temp_file);
}
}
}
}sub search {
@terms = split(/\s+/, $FORM{'terms'});
foreach $FILE (@FILES) {
open(FILE,"$FILE");
@LINES = <FILE>;
close(FILE);$string = join(' ',@LINES);
$string =~ s/\n//g;
if ($FORM{'boolean'} eq 'AND') {
foreach $term (@terms) {
if ($FORM{'case'} eq 'Insensitive') {
if (!($string =~ /$term/i)) {
$include{$FILE} = 'no';
last;
}
else {
$include{$FILE} = 'yes';
}
}
elsif ($FORM{'case'} eq 'Sensitive') {
if (!($string =~ /$term/)) {
$include{$FILE} = 'no';
last;
}
else {
$include{$FILE} = 'yes';
}
}
}
}
elsif ($FORM{'boolean'} eq 'OR') {
foreach $term (@terms) {
if ($FORM{'case'} eq 'Insensitive') {
if ($string =~ /$term/i) {
$include{$FILE} = 'yes';
last;
}
else {
$include{$FILE} = 'no';
}
}
elsif ($FORM{'case'} eq 'Sensitive') {
if ($string =~ /$term/) {
$include{$FILE} = 'yes';
last;
}
else {
$include{$FILE} = 'no';
}
}
}
}
if ($string =~ /<title>(.*)<\/title>/i) {
$titles{$FILE} = "$1";
}
else {
$titles{$FILE} = "$FILE";
}
}
}
Sorry about the looong post.
BTW-I left out the last sub that writes the html because I didn't think it relevant.
Thanks for all of the help, everyone!