problem with database results reaching the browser 
Author Message
 problem with database results reaching the browser

The code below  goes into a MySQL data base on a remote server (UNIX)
and selects data. When  I  access the server using  SSH2 telnet and enter
the command
'./somecode.cgi', it runs without errors and prints the data on the command
line of  the UNIX shell.

What is printed there is correct, but  I need the SELECT results to be
displayed on the related web page  not on the UNIX command line. Only SERVER
ERROR MESSAGES  comes up on the browser at the related URL.

Does anybody have a possible explanation for this problem?

---------------- THE   CODE    IS    BELOW   -------------------

#!/usr/bin/perl -w
use DBI;
use diagnostics;
print "Content-type: text/html\n";
my $string = "dbi:mysql:db1";
my $database = 'db1';
my $user = 'user1';
my $password = 'pas1';
my $dbh = DBI->connect($string,$user,$password);
my $sex = "M";
my $sth = $dbh->prepare("SELECT name , owner FROM pet WHERE sex=?");
$sth->execute ($sex);



Sun, 22 Jun 2003 03:39:33 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Script result to Browser problem!

2. Different Results With Different Browsers

3. Perl script: given database query, show html result table

4. Flatfile Database Search - Displaying Results Query

5. randomizing results from a mysql database

6. CGI Database prog weird query results

7. Help needed: Perl Database Results

8. Help: Displaying Database search results

9. database: viewing large result sets in perl?

10. RESULT: comp.databases.berkeley-db passes 266:4

11. Limiting database results

12. Updating database - on perl CGI through browser


Powered by phpBB® Forum Software