I'm running mod_perl & MySQL on a Mac OSX machine with the following 
information at the start of the Apache server :
[Fri Aug 16 10:38:41 2002] [alert] httpd: Could not determine the 
server's fully qualified domain name, using 127.0.0.1 for ServerName
[Fri Aug 16 10:38:41 2002] [notice] Apache/1.3.26 (Darwin) PHP/4.2.2 
mod_perl/1.26 configured -- resuming normal operations
[Fri Aug 16 10:38:41 2002] [notice] Accept mutex: flock (Default: flock)
I'm trying to interface the hereafter described database with the 
following script :
The error is at the end : could you help me to fix it (Perhaps I've made 
a mistake in installing manually the DBI package which is probably 
inside of  /usr/libexec/httpd/libphp4.so)
#!/usr/bin/perl

# load module
use DBI();

# connect
my $dbh = DBI->connect("DBI:mysql:database=jobs;host=localhost", "root",
"", {'RaiseError' => 1});

# execute query
my $sth = $dbh->prepare("SELECT * FROM location");
$sth->execute();

         # iterate through resultset
         while(my $ref = $sth->fetchrow_hashref())
         {
         print "ID: $ref->{'id'}\nLocation: $ref->{'location'}\n\n";
         }

# clean up
$dbh->disconnect();

Database Description :
mysql> show tables;
+----------------+
| Tables_in_jobs |
+----------------+
| country        |
| degree         |
| department     |
| industry       |
| listing        |
| location       |
| r_education    |
| r_employment   |
| r_reference    |
| r_skill        |
| r_user         |
| salary         |
| subject        |
+----------------+
13 rows in set (0.00 sec)

mysql> select * from location;
+----+----------+
| id | location |
+----+----------+
|  1 | New York |
|  2 | London   |
|  3 | Paris    |
|  4 | Tokyo    |
|  5 | Bombay   |
+----+----------+
5 rows in set (0.48 sec)

Error from error_log file :
dyld: /usr/sbin/httpd multiple definitions of symbol __dig_vec
/usr/libexec/httpd/libphp4.so definition of __dig_vec
/Library/Perl/darwin/auto/DBD/mysql/mysql.bundle definition of __dig_vec
dyld: /usr/sbin/httpd multiple definitions of symbol __dig_vec
/usr/libexec/httpd/libphp4.so definition of __dig_vec
/Library/Perl/darwin/auto/DBD/mysql/mysql.bundle definition of __dig_vec
[Fri Aug 16 16:28:24 2002] [error] (22)Invalid argument: getsockname


Pierre Vaudrey
email [EMAIL PROTECTED]

Reply via email to