Rudy Lippan | 1 Oct 03:25 2003

Re: mysql <at> PERL Solaris SPARC

On Tue, 30 Sep 2003, Yuri Huitron Alvarado wrote:

> I'm running :
> 
> - Solaris 9 SPARC
> - Perl 5.8.0
> 
> and I installed :
> 
> * DBI
> * DBD::mysql
> 
> using MCPAN , but when I try to run a script , it answers : 

Do you mean -MCPAN or MCPAN?  Is it possible that root and the user that 
your are running mysql are using different Perls?

Rudy

--

-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules <at> m.gmane.org

mark | 1 Oct 13:02 2003
Picon

stylesheets

Hi,
Anyone know is it possible to place links to cascading stylesheets in perl
under apache? Is it possible to get perl  to use stylesheets?

**********************************************************************
This document is strictly confidential and is intended for use by
 the addressee unless otherwise indicated.
Allied Irish Banks
**********************************************************************

--

-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules <at> m.gmane.org

Dave Cash | 1 Oct 14:13 2003

Re: [perl-mysql] stylesheets

On Wed, 1 Oct 2003, mark wrote:

> Anyone know is it possible to place links to cascading stylesheets in perl
> under apache?

Sure.  Just print out the link tag in the appropriate place in your 
ourput (so it appears in the <head> section):

 print qq!<link rel="stylesheet" href="mystyles.css" type="text/css" />!;

> Is it possible to get perl  to use stylesheets?

I'm not sure what you're getting at here.  In CGI, Perl is just used
to generate HTML.  After that, the browser does all the work.  Links
to images, stylesheets, javascript libraries, etc. are all followed
(and processed) by the browser, not by Perl (under standard CGI
circumstances). 

Hope that helps.

Dave

/L\_/E\_/A\_/R\_/N\_/T\_/E\_/A\_/C\_/H\_/L\_/E\_/A\_/R\_/N\
Dave Cash                              Power to the People!
Frolicking in Fields of Garlic               Right On-Line!
dave <at> gnofn.org                                  Dig it all.

--

-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
(Continue reading)

Yuri Huitron Alvarado | 1 Oct 18:21 2003
Picon

Re: mysql <at> PERL Solaris SPARC

I type :

perl -MCPAN -e 'install Bundle::DBI'

and I only found one Perl; 5.8.0

*************************************************

      Yuri Huitrón Alvarado
Administrador de Servicios de Internet
 Coordinación General de Informática
  Universidad Autónoma de Coahuila

***************************************************
Hasta la madeja mas enredada tiene su cabo

---------- Original Message -----------
From: Rudy Lippan <rlippan <at> remotelinux.com>
To: Yuri Huitron Alvarado <clyuri <at> e420.uadec.mx>
Cc: perl <at> lists.mysql.com
Sent: Tue, 30 Sep 2003 21:25:24 -0400 (EDT)
Subject: Re: mysql  <at>  PERL Solaris SPARC

> On Tue, 30 Sep 2003, Yuri Huitron Alvarado wrote:
> 
> > I'm running :
> > 
> > - Solaris 9 SPARC
> > - Perl 5.8.0
> > 
(Continue reading)

Mike Garner | 2 Oct 08:05 2003

Placeholder question

I learned about placeholders/bind variables from this list and have been 
using them relatively successfully for a little bit now. However, the 
following query (a very simple one) doesn't work.
my $key='1';
my $name='mike';
$statement=<<"end";
update mentors set firstname=? where id=?;
end
$query=$dbh->prepare($statement);
$query->execute($name,$key) or die "Can't execute query: " . $dbh->errstr 
."\n";

#$query="update mentors set firstname='mike' where id=$key";
#$sth=$dbh->prepare($query);
#$sth->execute();

The commented query without placeholders works fine.  When I run it using 
the query that contains place holders I get this error:
DBD::mysql::st execute failed: You have an error in your SQL syntax near ';
' at line 1 at test.pl line 10.
DBD::mysql::st execute failed: You have an error in your SQL syntax near ';
' at line 1 at test.pl line 10.

Line 10 is the $query->execute($name,$key); line.  Any ideas?

Thanks,
Mike

--------------------------------------------------------------
Mike Garner
(Continue reading)

Mike Garner | 2 Oct 08:43 2003

Re: Placeholder question

Oops. It was the ; at the end of the $statement string...which is obvious 
now looking at the error.

At 12:05 AM 10/2/2003, Mike Garner wrote:
>I learned about placeholders/bind variables from this list and have been 
>using them relatively successfully for a little bit now. However, the 
>following query (a very simple one) doesn't work.
>my $key='1';
>my $name='mike';
>$statement=<<"end";
>update mentors set firstname=? where id=?;
>end
>$query=$dbh->prepare($statement);
>$query->execute($name,$key) or die "Can't execute query: " . $dbh->errstr 
>."\n";
>
>#$query="update mentors set firstname='mike' where id=$key";
>#$sth=$dbh->prepare($query);
>#$sth->execute();
>
>The commented query without placeholders works fine.  When I run it using 
>the query that contains place holders I get this error:
>DBD::mysql::st execute failed: You have an error in your SQL syntax near ';
>' at line 1 at test.pl line 10.
>DBD::mysql::st execute failed: You have an error in your SQL syntax near ';
>' at line 1 at test.pl line 10.
>
>Line 10 is the $query->execute($name,$key); line.  Any ideas?
>
>Thanks,
(Continue reading)

"Unternährer Thomas, uth" | 2 Oct 09:31 2003
Picon

A very easy mysql problem


I want to compare the password, which the user typed in (in a textfield) with a password, which is in a MySQL-db.

I tried the following:

	my $dbh = db_open("mypoll300903", "testuser", "authmysql");
	my $sth = $dbh->prepare("select password from table1 where prename = \"testprename\" and name = \"testname\";")
	    or die ($dbh->errstr);
	$sth->execute or die $sth->errstr;
	print "$sth";	
	$dbh->disconnect(); 

$sth is not yet what I want. It is something like the structure of what I need.

	I'd like to do the following:

	if ($passdb es $passusr) {   ## $passdb = the transformed $sth 
		$OK = 1;
	}

Any help will be greatly appreciated,

Thomas

Content Security by MailMarshal

--

-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules <at> m.gmane.org
(Continue reading)

"Unternährer Thomas, uth" | 2 Oct 11:50 2003
Picon

Again a question


Hi all,

I'm trying still to programm a websurvey with saving the data in a db.

On the first page the user has to fill out a form (some radiobuttons).

I would like to store the results in my MySQL-db. On this first site there are 3 variables $Q1-$Q2 for 3 questions.

Now I tried the following:

	print "<form action='$url' method='post'>";
    	 	my $daten = { Q1 => $Q1,
 			      Q2 => $Q2,
 			      Q3 => $Q3};
	 	my $dbh = db_open("mypoll300903", "testuser", "authmysql");
 		$dbh->disconnect();
 		&eintrag($dbh, $daten);
		print "<input type='hidden' name='Site' value='3'>";
		print "<input type='submit' name='submit' value='Zur nächsten Frage'>";
      print "</form>";

With the error-message, that the variables $Q1... Requires explicit package name.

I produce the HTML-part in a subprogram, where the number of questions can be give as an argument.

Any ideas, how I could do what I want or where I could find a documentation about this 
(havn't found it in perldoc DBI)

Thanks a lot
(Continue reading)

Ulrich Borchers | 2 Oct 13:09 2003
Picon

Re: Again a question

Please don't hate me but you should read some tutorials first 
and get familiar with a few things about cgi and mysql.
maybe google will give you a clue ("tutorial cgi mysql").

are you sure that you retrieve the posted vars $Q1... 
correctly from the environment ?

why do you disconnect before storing data (&eintrag) ?

outputting the form and storing data in the
same code block looks a little bit strange to me.

sorry,
uli

On 2 Oct 2003 at 11:50, Unternährer Thomas, uth wrote:

> 
> Hi all,
> 
> 
> I'm trying still to programm a websurvey with saving the data in a db.
> 
> On the first page the user has to fill out a form (some radiobuttons).
> 
> I would like to store the results in my MySQL-db. On this first site there are 3 variables $Q1-$Q2 for 3 questions.
> 
> Now I tried the following:
> 
> 	print "<form action='$url' method='post'>";
(Continue reading)

Aleksey Kishkin | 3 Oct 09:40 2003
Picon

Re: A very easy mysql problem

UnternДhrer Thomas wrote:
> 
> I want to compare the password, which the user typed in (in a textfield) 
> with a password, which is in a MySQL-db.
> 
> I tried the following:
> 
> 
> 	my $dbh = db_open("mypoll300903", "testuser", "authmysql");
> 	my $sth = $dbh->prepare("select password from table1 where prename = 
> \"testprename\" and name = \"testname\";")
> 	    or die ($dbh->errstr);
> 	$sth->execute or die $sth->errstr;
> 	print "$sth";	
> 	$dbh->disconnect(); 
> 
> $sth is not yet what I want. It is something like the structure of what I need.
>

After execution you must retrieve result records. Common way is:
my  <at> record;
while (  <at> record = $sth->fetchrow_array() )
{
 # here we have a result record in  <at> record
}

But as far as you expect only one record with only one field, you can perform 
it this way:

    my $dbh = db_open("mypoll300903", "testuser", "authmysql");
(Continue reading)


Gmane