On 12 May 98 at 9:12, Bruce Young wrote:
> One of my old free sites is moving to another server. I had hoped it
> would be one of my CF servers as I will need to do some DB work for
> it very soon. However... they have decided to put it on a Linux box
> (not sure of the flavour yet). That's fine, as it is currently on a
> Unix box and I know enough to do what I need to. The question now
> arises as to how can I do DB stuff without using Selena's or Matt's
> stuff. Peter S has mentioned using mSQL or mySQL and Perl in the
> past (lost it, sorry Peter). Any pointers here would be good also.
I am currently working at an ad agency and their intranet is on NT. I
am going to try and convince them to get CF and use it as an
advertising point. Seems everyone is happy with CF.
Forget Selena or Matt.
Use perl DBI/DBD. You write the code and choose a driver. You can
switch databases and code still works. OO and easy to do everything.
Here is a mailing list for Web Databases. The guy who wrote mySQL is
pretty active on it. Seems everyone prefers mySQL over mSQL:
>
> *********************************************
> * [EMAIL PROTECTED] *
> * THE web database discussion list *
> * This list is sponsored by hole-in-the.net *
> * http://www.hole-in-the.net/guy/webdb/ *
> *********************************************
And then the DBI mailing list:
----------------------------------------------------------------------
To unsubscribe from this list, please visit
http://www.fugue.com/dbi If you are without web access, or if you are
having trouble with the web page, please send mail to
[EMAIL PROTECTED] Please try to use the web page first - it
will take a long time for your request to be processed by hand.
----------------------------------------------------------------------
Of course I have plenty of examples on my site. But I have a lot of
bad examples as well.
Here is an example of an insert:
&insert("$table",\@insert_names,\@insert_values);
and I use similar routines for update and delete. Modifies I do by
hand but I think you can see it is quite easy.
Peter
################################################################
sub insert {
my($table,$ra_names,$ra_values) = @_;
my $values = join ',', @$ra_values;
my $names = join ',', @$ra_names;
$sql_insert = " INSERT INTO $table($names)
VALUES($values)
";
$sth = $dbh->prepare("$sql_insert") || &print_error("Can't prepare
statement: $DBI::errstr<p>$sql_insert"); $rc = $sth->execute ||
&print_error("Can't execute statement: $DBI::errstr<P>$sql_insert");
$sth->finish;
if ($debug == "1") {
print<<END;
SQL: $sql_insert
<hr>
END
}
}
#################################################################
_________________________________________________________
Peter J. Schoenster [EMAIL PROTECTED]
Exercise Your Brain..Read a Book http://www.rede.com/
Free CGI Scripts and Applications
http://www.rede.com/samples/index.html
____________________________________________________________________
--------------------------------------------------------------------
Join The Web Consultants Association : Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------