View Full Version : Perl test script to create tables
Is there a simple Perl script for making tables that I can use to test my installation and configuration? If there is, please send the code with instructions and expected results.
I'm assuming (not sure) that DBI and drivers are already installed in ns3.powweb.com for mysql02.powweb.com and the script should be set to chmod 755.
4-19-03, 04:27 AM
you assume correctly. both DBI and the mysql driver are installed on all powweb webservers. however, you'd be using the script on your webserver, not a nameserver or a dbserver. webservers provide the link between the data source (mysql02 in this case) and the end user.
if you want to perform diagnostics or operations of any sort on your database, i suggest mysql front or phpMyAdmin.
print "Content-type: text/html\n\n";
$dbh = DBI->connect($info,$user,$pass);
$query = "create table tablename (fieldname datatype(value), fieldname datatype(value))";
$sth = $dbh->prepare($query);
if $sth->execute() print "<br>It worked</br>";
you need to edit this to reflect your database settings and the table you want to creat with its types and default values.
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.