Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

mysql connectivity...
I have a table like so:

id -> auto increment
name -> name

After I insert a new name
insert into mytable values('','Bob');

I need Bob's id returned.




Report this thread to moderator Post Follow-up to this message
Old Post
Michael Gargiullo
10-28-04 01:55 AM


Re: mysql connectivity...
On Wed, 27 Oct 2004, Michael Gargiullo wrote:

> I have a table like so:
>
> id -> auto increment
> name -> name
>
> After I insert a new name
>   insert into mytable values('','Bob');
>
> I need Bob's id returned.

Hey, wait -- you could write a program to do that, couldn't you!

And reading `perldoc DBD::mysql` would totally show you how!

(Hint -- search in the perldoc for 'insertid'.)


--
Chris Devers

Report this thread to moderator Post Follow-up to this message
Old Post
Chris Devers
10-28-04 01:55 AM


Re: mysql connectivity...
On Wed, 2004-10-27 at 15:42, Chris Devers wrote:
> On Wed, 27 Oct 2004, Michael Gargiullo wrote:
> 
>
> Hey, wait -- you could write a program to do that, couldn't you!
>
> And reading `perldoc DBD::mysql` would totally show you how!
>
> (Hint -- search in the perldoc for 'insertid'.)
>

Thanks Chris,

I was using the PHP function instead of perl's...


Report this thread to moderator Post Follow-up to this message
Old Post
Michael Gargiullo
10-28-04 01:55 AM


Re: mysql connectivity...
On Wed, 27 Oct 2004, Michael Gargiullo wrote:

> On Wed, 2004-10-27 at 15:42, Chris Devers wrote: 
>
> Thanks Chris,
>
> I was using the PHP function instead of perl's...

You did look it up, right?

I deliberately gave only part of the string you need to use...


--
Chris Devers

Report this thread to moderator Post Follow-up to this message
Old Post
Chris Devers
10-28-04 01:55 AM


Re: mysql connectivity...
On Wed, 2004-10-27 at 16:16, Chris Devers wrote:
> On Wed, 27 Oct 2004, Michael Gargiullo wrote:
> 
>
> You did look it up, right?
>
> I deliberately gave only part of the string you need to use...
>

Yup...  $id=$dbh->{'mysql_insertid'};  Worked like a charm.


Report this thread to moderator Post Follow-up to this message
Old Post
Michael Gargiullo
10-28-04 01:55 AM


Re: mysql connectivity...
On Wed, 27 Oct 2004, Michael Gargiullo wrote:

> On Wed, 2004-10-27 at 16:16, Chris Devers wrote: 
>
> Yup...  $id=$dbh->{'mysql_insertid'};  Worked like a charm.

Good -- now you know how to find future answers :-)



--
Chris Devers

Report this thread to moderator Post Follow-up to this message
Old Post
Chris Devers
10-28-04 01:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:59 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.