List:General Discussion« Previous MessageNext Message »
From:Gerald Preston Date:March 17 2005 6:03pm
Subject:RE: insert was working
View as plain text  
Richard, 

Explain auto_increment field please.

Thanks,

Jerry

-----Original Message-----
From: Richard Whitney [mailto:rw@stripped] 
Sent: Thursday, March 17, 2005 10:31 AM
To: Gerald Preston
Cc: mysql@stripped
Subject: Re: insert was working

Gerald!

Do you have an auto_increment field?
If so, what's it set as?

Richard

Quoting Gerald Preston <jwp@stripped>:

> Hi!
>
>
>
> I was able to insert data with the following:
>
>
>
> sub insert_sql {
>
>
>
>   my ( $group_name, $me, $daily, $item, $unit, $qty, $amount, $tax,
$total,
> $DEBUG ) = @_;
>
>
>
>   print "\n**club_sql.pl**insert_sql**@_**\n" if $DEBUG;
>
>   ( $group_name, $me, $daily, $item, $unit, $qty, $amount, $tax, $total )
=
> &clean_sql( $group_name, $me, $daily, $item, $unit, $qty, $amount, $tax,
> $total, $DEBUG );
>
>   print "\ninsert_sql -
> *$group_name*$me*$daily*$item*$unit*$qty*$amount*$tax*$total*\n" if
$DEBUG;
>
>   my $dbh = DBI->connect( "DBI:mysql:club","gjwpp88","password" ) || die
> "\n$DBI::errstr\n";
>
>   my $sql = "insert into wolfies( group_name, me, daily, item, unit, qty,
> amount, tax, total )
>
>                           values( ?,          ?,  ?,     ?,    ?,    ?,
?,
> ?,   ?     )";
>
>   my $sth = $dbh->prepare( $sql ) || die $dbh->errstr;
>
>   $sth->execute( $group_name, $me, $daily, $item, $unit, $qty, $amount,
> $tax, $total ) || die "Cannot execute insert_sql!!\n$DBI::errstr";
>
> }1;
>
>
>
> I am no longer able to insert any data at all.  No errors, nothing.  It
acts
> like it works. But I am able to select existing data with the following:
>
>
>
> sub select_sql {
>
>
>
>   my ( $me, $daily, $DEBUG ) = @_;
>
>   my %data = ();
>
>
>
>   print "\n**club_sql.pl**select_sql**@_**\n" if $DEBUG;
>
>   $me     =~ s/\s+//;
>
>   $daily  =~ s/\s+//;
>
>   my $dbh = DBI->connect( "DBI:mysql:club","gjwpp88","password" ) or die
> "\n$DBI::errstr\n";
>
>   my $sql = "select group_name, me, daily, item, unit, qty, amount, tax,
> total
>
>              from   wolfies
>
>              where  me    = '$me'
>
>              and    daily = '$daily'
>
>             ";
>
>   print "sql *$sql*\n" if $DEBUG;
>
>   my $sth = $dbh->prepare( $sql ) || die "$DBI::errstr\n";
>
>   my $rv  = $sth->execute() || die "Cannot execute
> select_sql!!<br>$DBI::errstr";
>
>   while( my ( $group_name, $me, $daily, $item, $unit, $qty, $amount, $tax,
> $total ) = $sth->fetchrow() ) {
>
>     print "\nselect_sql $group_name, $me, $daily, $item, $unit, $qty,
> $amount, $tax, $total*\n" if $DEBUG;
>
>     push @{ $data{ $group_name }}, "$item, $unit, $qty, $amount, $tax,
> $total";
>
>   }
>
>   return \%data;
>
> }1;
>
>
>
> I have done the following setup options:
>
>
>
> GRANT ALL PRIVILEGES ON club.* TO 'gjwpp88'@'localhost';
>
>
>
> SET PASSWORD FOR 'gjwpp88'@'localhost' = PASSWORD('password');
>
>
>
> UPDATE mysql.user SET Password = OLD_PASSWORD('password')
>
> WHERE Host = 'localhost' AND User = 'gjwpp88';
>
>
>
> SET PASSWORD FOR 'gjwpp88'@'localhost' = OLD_PASSWORD('password');
>
>
>
> SELECT 'localhost', 'gjwpp88', Password FROM mysql.user
>
> WHERE LENGTH('password') > 16;
>
>
>
>
>
>
>
> FLUSH PRIVILEGES;
>
>
>
> Any ideas?
>
>
>
> Thanks,
>
>
>
> Jerry
>
>


R. Whitney
Transcend Development
"Producing the next phase of your internet presence"
http://xend.net
Premium Quality Web Hosting
http://xendhosting.com
rw AT xend.net
Net Binder  http://netbinder.net
310-943-6498
602-288-5340


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=1




Thread
insert was workingGerald Preston17 Mar
  • Re: insert was workingRichard Whitney17 Mar
    • RE: insert was workingGerald Preston17 Mar